-
Notifications
You must be signed in to change notification settings - Fork 23
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
Multiple Joint State Topics #26
Comments
The line 151 in topic_based_system.cpp shows this package only saves latest joint state topic. The topic that this package publishes contains the joint commands of multiple joints. |
Hi, thanks for the response. So you mean I just publish both messages independently or would I have to join them into a single message? |
You should join each wheel states into a single message. |
Oh okay I see, thank you so much! One last question, would that message be a joint state sequence then? |
What do you mean a joint state sequence? |
As in, since I'm using micro-ROS, they have a message type for Joint State messages that forms a sequence (vector of joint state messages I feel like) /**
* This is a message that holds data to describe the state of a set of torque controlled joints.
*
* The state of each joint (revolute or prismatic) is defined by:
* * the position of the joint (rad or m),
* * the velocity of the joint (rad/s or m/s) and
* * the effort that is applied in the joint (Nm or N).
*
* Each joint is uniquely identified by its name
* The header specifies the time at which the joint states were recorded. All the joint states
* in one message have to be recorded at the same time.
*
* This message consists of a multiple arrays, one for each part of the joint state.
* The goal is to make each of the fields optional. When e.g. your joints have no
* effort associated with them, you can leave the effort array empty.
*
* All arrays in this message should have the same size, or be empty.
* This is the only way to uniquely associate the joint name with the correct
* states.
*/
typedef struct sensor_msgs__msg__JointState
{
std_msgs__msg__Header header;
rosidl_runtime_c__String__Sequence name;
rosidl_runtime_c__double__Sequence position;
rosidl_runtime_c__double__Sequence velocity;
rosidl_runtime_c__double__Sequence effort;
} sensor_msgs__msg__JointState;
// Struct for a sequence of sensor_msgs__msg__JointState.
typedef struct sensor_msgs__msg__JointState__Sequence
{
sensor_msgs__msg__JointState * data;
/// The number of valid items in data
size_t size;
/// The number of allocated items in data
size_t capacity;
} sensor_msgs__msg__JointState__Sequence;
#ifdef __cplusplus
}
#endif
#endif // SENSOR_MSGS__MSG__DETAIL__JOINT_STATE__STRUCT_H_ Or would it just be a case of placing multiple entries into the following structs: rosidl_runtime_c__String__Sequence name;
rosidl_runtime_c__double__Sequence position;
rosidl_runtime_c__double__Sequence velocity;
rosidl_runtime_c__double__Sequence effort; |
Sorry, I don't know micro-ROS well.
Right Wheel Message
Integrated Message
|
Oh I see, I'll try putting in the names and data into the joint state message arrays. Thank you ! |
Hi, I was able to get the robot system running and can see the topics for command and state interfaces on my rqt_graph shown below : However, when I publish twist messages to the \manual_cmd_vel topic using the teleop_twist_keyboard, I don't see anything on the joint_ctrl topic which I specified as the command interface topic. The way I understood it is that the DiffDrive Controller will calculate the forward kinematics given the twist messages and then use the hardware interfaces (topics in this case) to set the actual joint commands - yet Im not sure of how to actually connect the two. Thanks! |
I forgot important information. The simple solution is comment out below line in line 275 in src/topic_based_system.cpp.
|
Oh right I see. What would commenting out that line do? I also saw your pull requests and wanted to ask if you know if it works with something like the DiffDrive controller, if so, could I use your changes in my project? |
In the simple solution, joint command is published every time. In my pull request, joint command is published when velocity command is not zero. |
Oh epic! I'll try it out. Thank you! |
Hi,
I am trying to use this package to read joint states of two of my wheels which are being published by an ESP32 via a Micro-ROS agent. As of now, I have made it so that each wheel state is published to its' own topic.
So I am a bit unsure of how this would integrate with this package.
Thank you!
The text was updated successfully, but these errors were encountered: