Hello, Recently, I have been working on the Torxis motors which are used in my robotic arm. I am sending six different joint values to six motors from RViz and I was able to move the robotic arm. The problem arises when I am fetching the joint values from the motor feedback. The feedback we receive is a 16-bit integer data that is stored in a variable with datatype "word". Now, I am trying to convert this "word" datatype into Float64 and was trying to publish it onto a ROS topic where there is a lot variation in the data that I am seeing on the topic. Actually, I was expecting a single value as I was giving stable joint values without any change but I ended up receiving a range of values varying at very a high rate on the topic. The feedback function is given below. I need to convert the variable data to a Float64 data.
word feedBack(byte address)
{
word data = 0;
byte low, high;
Serial2.write(header);
Serial2.write(address);
Serial2.write(feed1);
while(!Serial2.available()){}
low = Serial2.read();
high = Serial2.read();
//Serial.println(data);
//low = 0; high = 1;
data = high;
data = data << 8 | low;
data = 4095-data;
return data;
}
Originally posted by Apuroop on ROS Answers with karma: 3 on 2018-05-28
Post score: 0