実際のところ
前回のvcstoolsでやる方法であれば、そのままdemoリポジトリが構築されてるので
$ sudo apt-get install -y ros-${ROS_DISTRO}-joint-state-publisher-gui ros-${ROS_DISTRO}-rviz2$ cd ~/ros2_ws $ ros2 launch ros2_control_demo_example_1 rrbot.launch.py

別の端末でコントローラーのリストを表示すると、
環境構築のときと違いインターフェイスが出てくる事が確認できます
$ ros2 control list_controllers forward_position_controller[forward_command_controller/ForwardCommandController] active joint_state_broadcaster[joint_state_broadcaster/JointStateBroadcaster] active
リストを出した端末で先ほど出したトピックに対し動作コマンドを送ると……
ros2 topic pub /forward_position_controller/commands std_msgs/msg/Float64MultiArray "data: - 0.5 - 0.5"
状態の表示も可能
$ ros2 topic echo /joint_stateses
header:
stamp:
sec: 1700139246
nanosec: 984439130
frame_id: ''
name:
- joint1
- joint2
position:
- 0.4999597484566665
- 0.4999597484566665
velocity:
- .nan
- .nan
effort:
- .nan
- .nan
---
header:
stamp:
sec: 1700139247
nanosec: 84504910
frame_id: ''
...
