-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Things to fix in the wiki #2
Comments
Another mistake in the parts: |
It's fixed. Thank you!
Fixed.
Sorry, I'm checking this right now, wait for a bit.
Fixed, Please check here again.
Fixed. Thanks!!!! |
Thanks Takayuki! just noticed one other thing: the controller battery connectors aren't in the buying list either. Thank you! Here is a video of my first working IMU. Haven't calibrated them yet and is already very good! I am planning on making an app for mapping the gestures from motioner to sound, I'll send you my updates! |
You could also put in the buying list the servo motor and mdf boards for calibration... |
Here's MOTIONER mbed code, the place will be changed. https://developer.mbed.org/users/FalconOnishi/code/MotionerController/ and yes, we chose 6AA battery pack when we published, since Lipo battery is sometimes a bit dangerous. But maybe it's good to add description for who wanna use it.
Thanks for sharing your video.
Great! We'd love to add these. |
One other thing, Ito Since my board isn't sending any OSC messages (I checked with the motioner app as well as with PureData and also with OSC data monitor) I don't know if the problem is in the Controller Board, in the mbed code or in the XBee itself. There seems to be something going a lot wrong since the voltage regulator and the CAN controller are heating up a lot! After some seconds the four mbed leds 1 and 4 start blinking alternately with the leds 2 and 3, which is a mbed code error alert. I checked the voltage in all the power elements, and the 5v for mbed and 3.3v for xbee are fine. Since I've never used mbed or xbee wifi before its taking a lot to understend the mbed code, but I hope I find a way to fix this problem. Can it be a problem that I'm using only one IMU sensor to test? Does the mbed code break if all the sensors aren't connected? That wouldn't make sense, and the code doesn't seem to have anything like that. I want to, at first, use only 3 IMUs to monitor just one arm, so I just bought enough components to make these 3. Hope I can make them work soon... It would be nice to specify in the list you used XBee Wifi S6 Thank you! |
I have read all the three codes of IMU, Controller and Motion App, the message from IMU is include velocity and the control message is 'q': void MotionerIMU::updateCAN()
{
switch (getCANControlMessage()) {
case 0: break; /// no message
case 'q':
//Serial.println("StartTransfer");
digitalWrite(LED, HIGH);
sendCANDataQuaternion();
sendCANDataAux();
digitalWrite(LED, LOW);
break;
default: break;
}
} But Controller only read the quaternion and send it to Motioner App: // 0to18 Joints and RX buffer*2(quaternion xy or zw) and 8 byte CAN data
if (nodeId < N_JOINTS && slot < 2 && msg.len == 8) {
//gPc.printf("%x, %x\n\r", nodeId, slot);
for (int q=0; q<2; q++) { //quaternion x, y or z, w
for (int f=0; f<4; f++) { //float byte 0 - 4
//[node id][quaternion x, y or z, w][float bytes 0 - 4]
gTmpQuat[nodeId][q+slot*2].b[f] = msg.data[f+q*4];
}
}
} And I don't understand why did you add the position vector to the data length, but not send anything of it: #define N_JOINTS (18)
#define DATA_LEN (4*4*N_JOINTS+3*4+4) //18*quaternion*float bytes + position vector*flot bytes + delimiter void updateXBeeWiFi()
{
IPv4TransmitRequest data;
//XBee WiFi Transmit
//IPv4TransmitRequest data;
//int len = 2*4*18+2*3; //18*quaternion+3*vector q // short
//int len = 4*4*18+4*3; //18*quaternion+3*vector // float
//int len = 8; //18*quaternion+3*vector // float
//char buf[len];
// debug
//for (int i=0; i<len; i++)
//buf[i] = (char)('0'+i%70);
for (int i=0; i<N_JOINTS; i++) {
if (gReceived[i][0] && gReceived[i][1]) {
for (int j=0; j<4; j++) {
__gQuat__[i][j] = gTmpQuat[i][j].f;
}
}
}
uint8_t *buf = (uint8_t *)__gQuat__;
buf[DATA_LEN-4] = (char)'a';
buf[DATA_LEN-3] = (char)'b';
buf[DATA_LEN-2] = (char)'c';
buf[DATA_LEN-1] = (char)'d';
IpAddr addr(192, 168, 2, 1);
data.setAddress(addr);
data.setDstPort(9750);
data.setSrcPort(9750);
data.setProtocol(PROTOCOL_UDP);
//data.setPayload((uint8_t*)buf);
//data.setPayloadLength(strlen(buf));
data.setPayload(buf);
data.setPayloadLength(DATA_LEN);
data.setFrameId(gXBee.getNextFrameId());//0
gXBee.send(data);
//gPc.printf("len:%d\r\n",strlen(buf));
const int r = gXBee.getWiResponse(TX_STATUS_RESPONSE, data.getFrameId());
/// error
if (r==-1) {
gPc.printf("Fatal error! XBee WiFi didn't responce!\r\nTrying to reset modem again.");
if (initXBeeWiFi(20)) {
gPc.printf("Failure...");
error("");
} else {
gPc.printf("succeed\r\n");
}
}
} And the CAN control message send from Controller to IMU is 'b' and 'e', not 'q': void beginTransmitQuaternion()
{
sendCanMessage('b');
for (int i=0; i<N_MBED_CAN; i++)
sendMbedCanMessage(i, 'b');
}
//--------------------------------------------------------------
void endTransmitQuaternion()
{
sendCanMessage('e');
for (int i=0; i<N_MBED_CAN; i++)
sendMbedCanMessage(i, 'e');
} And the Motioner App read velocity from the message sent from Controller: const int FLOAT_BYTES = 4;
const int QUATERNION_DIM = 4;
const int IMU_DATA_DIM = 5;
const int UDP_MESSAGE_LENGTH = IMU_DATA_DIM*FLOAT_BYTES*(NUM_JOINTS-N_END_SITE)+4;
const string UDP_PACKET_DELIMITER = "abcd"; for (int j=0; j<IMU_DATA_DIM; j++) { /// quaternion xyzw + velocity
for (int k=0; k<FLOAT_BYTES; k++) { /// float bytes
/// i*4*5 + i*4 + k
const int idx =
(i-nEndSite)*IMU_DATA_DIM*FLOAT_BYTES + j*FLOAT_BYTES+k;
mData[i][j].b[k] = udpMessage[idx];
}
//if (ofGetFrameNum()%60==0)
// cout << mData[i][j].f << ",";
}
//if (ofGetFrameNum()%60==0)
// cout << endl;
/// get velocity
if (mData[i][4].f!=0.0f) {
//cout << i << ":" << mData[i][4].f << endl;
frame.velocity.at(i) = mData[i][4].f;
} According to all above, I judge that the code of Controller from mbed is old(or testing) version. Please check it, thank you. We are making the Motioner system according to your way, and now debug each parts together. |
The Controller code is old version, would you pls upload new version. Thx a lot. |
The new version? |
Hello,
I am making my Motioner sensors and I noticed some small mistakes in the wiki:
in the tutorial showing how to use the Arduino UNO as an ISP programmer, the frizzing image tells you have to put the capacitor between the 5V and the Reset... that is dangerous... it missed one hole, its between GND and Reset.
Another mistake is in the parts list, it says that for the IMU that the 10kOhm resistors are the R5-9, while they are only from R5 to R8.
And another thing I noticed is that the mbed code is the only one missing in the github. You only put the binary, and I really want to understand what is going on and maybe improve it a bit if I can. Can you please put it there?
One last thing: You added a calibration process in the making tutorial but forgot to put the referred folder in gitHub: "Open the MOTIONER/Arduino/calibration folder and open calibrationServo.ino"... there is no calibration folder there...
thanks a lot!
Amazing project!
I'm eager to contribute to it as much as I can!
The text was updated successfully, but these errors were encountered: