How to fill JointTrajectory structure with data
Has anybody examples how the JointTrajectory msg structure in ROS2 can be defined and filled with data in c++?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
I think these functions can get you a gist of how you use it with C++:
Knowledge of iterators and a bit of STL is assumed.
I think now it worked. With a few tries I did this:
auto hw_cmd = std::shared_ptr<trajectory_msgs__msg__JointTrajectory>() ;
std::string hip ="hip";
std::string shoulder ="shoulder";
hw_cmd->joint_names.data[0] = hip;
hw_cmd->joint_names.data[1] = shoulder;
Asked: 2022-11-05 15:45:51 -0600
Seen: 16,831 times
Last updated: Nov 06 '22