As you remember, in our earlier sections, we were able to move the robot around using keyboard. To do so, we need to start a new Terminal window:
$ ros2 run teleop_twist_keyboard teleop_twist_keyboard
While that window has focus, we could make our robot move. To recreate this functionality in our new setup, we need (same as before) add the joint state publisher:
params = { 'use_sim_time': use_sim_time}
joint_state_publisher_node = Node(
package='joint_state_publisher',
executable='joint_state_publisher',
name='joint_state_publisher',
parameters=[params],
#condition=launch.conditions.UnlessCondition(LaunchConfiguration('gui'))
)
...
# ... and call it:
ld.add_action(joint_state_publisher_node)
We also need to add the following code to package.xml:
Note, that we do not have to uncomment libgazebo_ros_joint_state_publisher.so (commented out in gazebo_control.xacro). I didn't try to investigate why it works, but the fact is, it does.