Starting with ROS on the Robot¶
Connecting your PC to through the middleware to the Platform¶
By default, all the distributions of ROS-2 uses Fast-RTPS as the middleware. We will continue to support the default middleware, and will do the changes according to the developments from the Open Robotics.
Establishing the connection with the PC and the robot have been already discussed in Getting Started.
Fast-RTPS being a DDS, uses Domain ID to differentiate between the groups of computer running ROS-2 on a same network. So by default, we set all the the domain id of our Robots to
1. Therefore the user needs to add the following line in the
~/.bashrc of their client-PC:
The above setting works only for the devices connected on the same network, technically having the same subnet mask.
Testing your connection¶
In general, when you turn on your newly brought robot, there is an autostart script for ROS, that would bringup all the necessary drivers and packages for the hardware components as part of the robot. In case if the instructions for automated workspace setup was followed, as explained in Installation, then autostart script would be already part of the Robot’s Desktop.
If in case you have installed ROS manually, then you need to do a manual bringup as follows:
ros2 launch neo_mpo_700 bringup.launch.py
After completing the ROS network configuration your PC should be able to connect to the ROSon the platform. To check the connection you can try to list the available topics:
ros2 topic list
It should show the topics as follows:
/cmd_vel /diagnostics /drives/joint_states /drives/joint_states_raw /drives/joint_trajectory /joint_states /joy /joy/set_feedback /lidar_1/scan /lidar_1/scan_filtered /lidar_2/scan /lidar_2/scan_filtered /odom /relayboard_v2/battery_state /relayboard_v2/emergency_stop_state /relayboard_v2/state /rosout /rosout_agg /tf /tf_static
Visualize the data with RViz¶
A pre-configured visualization can be started via a ROS launch file with your robot as follows:
ros2 launch neo_mp_400 rviz.launch.py ros2 launch neo_mp_500 rviz.launch.py ros2 launch neo_mpo_500 rviz.launch.py ros2 launch neo_mpo_700 rviz.launch.py
You can use the left stick for movement in X and Y direction and the right stick for rotating. Please make sure to set the joystick to D-mode (found on the top) before teleop.
Note: MP-400 and MP-500 cannot move in Y direction.