ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can use the --field flag of the ros2 topic echo command. Here is an example:

ros2 topic echo /imu_test --field linear_acceleration

which will give the output

x: 0.0
y: 0.0
z: 0.0
---

You can go further into the field by putting periods after each subsection, so

ros2 topic echo /imu_test --field linear_acceleration.x

will give you

0.0
---