Publishing joint_states for custom differential type robot in C++

asked 2022-04-01 03:07:25 -0500

tonaaskarwur gravatar image

I am trying to publish joint_states for a real robot which is written using C++. The robot is a differential type robot, running under ROS2 foxy, with a PLC controller. My understanding is that I need to define the msgs of the joint_states, which are defined as follows: - string[] name - float64[] position - float64[] velocity - float64[] effort

The position data can be obtained from the encoder ticks in one revolution, then convert them to radians. So far this works well on my robot, even without any definition of velocity and effort.

My question is: 1. Is it necessary to define the other msgs to get a more optimal result? If so, 2. How to define the velocity or effort msg?

I use the turtlebot3 github repository as a benchmark, and they got the velocity msg for joint states by calculating them from RPM to MS. I am not sure what these stand for (revolution per meter and meter per second?). Thank you.

edit retag flag offensive close merge delete

Comments

I think the answer to your first question is "what are you needing to accomplish with the joint state message?" Are you controlling your robot to joint positions? Or to joint velocities? RPM (Rotations per minute). MS (meters per second) Specifying the linear velocity in a rotational joint doesn't really make sense. I'd recommend publishing a twist message to provide linear velocities, and angular velocities of the robot as a whole. But again, depends on what you're trying to accomplish.

ChuiV gravatar image ChuiV  ( 2022-04-05 10:28:19 -0500 )edit