Hood NUC Melih ROS2 TB3 Bringup and Test

From wikidb
Jump to: navigation, search

Context

January 18, 2020

Reference

See Melih "Test Turtlebot 3"

Test TB3

See Melih's tutorial section "Test Turtlebot 3"

Initial Conditions

  • At system boot
  • OpenCR connected
  • Power connected to OpenCR
  • OpenCR turned on
  • LIDAR was connected but is not required. It is now unplugged.

Indicator LEDs

Initialize Each Terminal

Terminal 1

 eepp@hood:turtlebot3_ws$ export TURTLEBOT3_MODEL=waffle

 eepp@hood:turtlebot3_ws$ source ~/ros2_all_ws/ros2_ws/install/setup.bash
     ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
     ROS_DISTRO was set to 'dashing' before. Please make sure that the environment does not mix paths from different distributions.

 eepp@hood:turtlebot3_ws$ source ~/ros2_all_ws/turtlebot3_ws/install/setup.bash
     ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
     ROS_DISTRO was set to 'dashing' before. Please make sure that the environment does not mix paths from different distributions.

 eepp@hood:turtlebot3_ws$ source ~/ros2_all_ws/navstack_dependencies_ws/install/setup.bash
     ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
     ROS_DISTRO was set to 'dashing' before. Please make sure that the environment does not mix paths from different distributions.

 eepp@hood:turtlebot3_ws$ source ~/ros2_all_ws/navigation2_ws/install/setup.bash
     ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions.
     ROS_DISTRO was set to 'dashing' before. Please make sure that the environment does not mix paths from different distributions.

Terminal 2

Same as terminal 1

Bring up TB3

Terminal 1

 eepp@hood:~$ ros2 launch turtlebot3_bringup robot.launch.py
     [INFO] [launch]: All log files can be found below /home/eepp/.ros/log/2020-01-23-20-06-30-360853-hood-7179
     [INFO] [launch]: Default logging verbosity is set to INFO
     urdf_file_name : turtlebot3_waffle.urdf
     [INFO] [robot_state_publisher-1]: process started with pid [7190]
     [INFO] [hlds_laser_publisher-2]: process started with pid [7191]
     [INFO] [turtlebot3_ros-3]: process started with pid [7192]
     [robot_state_publisher-1] Initialize urdf model from file: /home/eepp/ros2_all_ws/turtlebot3_ws/install/turtlebot3_description/share/turtlebot3_description/urdf/turtlebot3_waffle.urdf
     [robot_state_publisher-1] Parsing robot urdf xml string.
     [robot_state_publisher-1] Link base_link had 7 children
     [robot_state_publisher-1] Link camera_link had 2 children
     [robot_state_publisher-1] Link camera_depth_frame had 1 children
     [robot_state_publisher-1] Link camera_depth_optical_frame had 0 children
     [robot_state_publisher-1] Link camera_rgb_frame had 1 children
     [robot_state_publisher-1] Link camera_rgb_optical_frame had 0 children
     [robot_state_publisher-1] Link caster_back_left_link had 0 children
     [robot_state_publisher-1] Link caster_back_right_link had 0 children
     [robot_state_publisher-1] Link imu_link had 0 children
     [robot_state_publisher-1] Link base_scan had 0 children
     [robot_state_publisher-1] Link wheel_left_link had 0 children
     [robot_state_publisher-1] Link wheel_right_link had 0 children
     [robot_state_publisher-1] got segment base_footprint
     [robot_state_publisher-1] got segment base_link
     [robot_state_publisher-1] got segment base_scan
     [robot_state_publisher-1] got segment camera_depth_frame
     [robot_state_publisher-1] got segment camera_depth_optical_frame
     [robot_state_publisher-1] got segment camera_link
     [robot_state_publisher-1] got segment camera_rgb_frame
     [robot_state_publisher-1] got segment camera_rgb_optical_frame
     [robot_state_publisher-1] got segment caster_back_left_link
     [robot_state_publisher-1] got segment caster_back_right_link
     [robot_state_publisher-1] got segment imu_link
     [robot_state_publisher-1] got segment wheel_left_link
     [robot_state_publisher-1] got segment wheel_right_link
     [turtlebot3_ros-3] [INFO] [1579838790.542159030] [turtlebot3_node]: Init TurtleBot3 Node Main
     [turtlebot3_ros-3] [INFO] [1579838790.543214023] [turtlebot3_node]: Init DynamixelSDKWrapper
     [turtlebot3_ros-3] [INFO] [1579838790.543598816] [DynamixelSDKWrapper]: Succeeded to open the port(/dev/ttyACM0)!
     [turtlebot3_ros-3] [INFO] [1579838790.545177718] [DynamixelSDKWrapper]: Succeeded to change the baudrate!
     [robot_state_publisher-1] Adding fixed segment from base_footprint to base_link
     [robot_state_publisher-1] Adding fixed segment from base_link to camera_link
     [robot_state_publisher-1] Adding fixed segment from camera_link to camera_depth_frame
     [robot_state_publisher-1] Adding fixed segment from camera_depth_frame to camera_depth_optical_frame
     [robot_state_publisher-1] Adding fixed segment from camera_link to camera_rgb_frame
     [robot_state_publisher-1] Adding fixed segment from camera_rgb_frame to camera_rgb_optical_frame
     [robot_state_publisher-1] Adding fixed segment from base_link to caster_back_left_link
     [robot_state_publisher-1] Adding fixed segment from base_link to caster_back_right_link
     [robot_state_publisher-1] Adding fixed segment from base_link to imu_link
     [robot_state_publisher-1] Adding fixed segment from base_link to base_scan
     [robot_state_publisher-1] Adding moving segment from base_link to wheel_left_link
     [robot_state_publisher-1] Adding moving segment from base_link to wheel_right_link
     [turtlebot3_ros-3] [INFO] [1579838790.588465931] [turtlebot3_node]: Start Calibration of Gyro
     [turtlebot3_ros-3] [INFO] [1579838795.588973986] [turtlebot3_node]: Calibration End
     [turtlebot3_ros-3] [INFO] [1579838795.589215048] [turtlebot3_node]: Add Motors
     [turtlebot3_ros-3] [INFO] [1579838795.590737161] [turtlebot3_node]: Add Wheels
     [turtlebot3_ros-3] [INFO] [1579838795.591533784] [turtlebot3_node]: Add Sensors
     [turtlebot3_ros-3] [INFO] [1579838795.596105356] [turtlebot3_node]: Succeeded to create battery state publisher
     [turtlebot3_ros-3] [INFO] [1579838795.597209449] [turtlebot3_node]: Succeeded to create imu publisher
     [turtlebot3_ros-3] [INFO] [1579838795.599002722] [turtlebot3_node]: Succeeded to create sensor state publisher
     [turtlebot3_ros-3] [INFO] [1579838795.599900611] [turtlebot3_node]: Succeeded to create joint state publisher
     [turtlebot3_ros-3] [INFO] [1579838795.599999528] [turtlebot3_node]: Add Devices
     [turtlebot3_ros-3] [INFO] [1579838795.600034230] [turtlebot3_node]: Succeeded to create motor power server
     [turtlebot3_ros-3] [INFO] [1579838795.601941333] [turtlebot3_node]: Succeeded to create reset server
     [turtlebot3_ros-3] [INFO] [1579838795.603099957] [turtlebot3_node]: Succeeded to create sound server
     [turtlebot3_ros-3] [INFO] [1579838795.603867740] [turtlebot3_node]: Run!
     [turtlebot3_ros-3] [INFO] [1579838795.622835516] [diff_drive_controller]: Init Odometry
     [turtlebot3_ros-3] [INFO] [1579838795.627781779] [diff_drive_controller]: Run!

Indicator LEDs

  • USER1: Amber blinking indicates pub/subscribe
  • USER2: dido
  • USER3: off
  • USER4: Green on solid
  • STATUS: off
  • ARDUINO: Green blinking
  • POWER: Green on solid

OpenCRLEDs.png

Sourch [OpenCR 1.0 Robotis eManual User LEDs Section 3.2

Test 2: Publish and subscribe

 eepp@hood:~$ ros2 topic list
     /battery_state
     /cmd_vel
     /imu
     /joint_states
     /magnetic_field
     /odom
     /parameter_events
     /robot_description
     /rosout
     /scan
     /sensor_state
     /tf
     /tf_static

Test 2: Motor test from command line

Start and stop motors

Terminal 2

 eepp@hood:~$ ros2 topic pub /cmd_vel geometry_msgs/Twist '{linear: {x: 1.0}}' -1
     publisher: beginning loop
     publishing #1: geometry_msgs.msg.Twist(linear=geometry_msgs.msg.Vector3(x=1.0, y=0.0, z=0.0), angular=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=0.0))

 eepp@hood:~$ ros2 topic pub /cmd_vel geometry_msgs/Twist '{linear: {x: 0.0}}' -1 
     publisher: beginning loop
     publishing #1: geometry_msgs.msg.Twist(linear=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=0.0), angular=geometry_msgs.msg.Vector3(x=0.0, y=0.0, z=0.0))

Test 3: Motor test from keyboard

Terminal 2

 eepp@hood:~$ ros2 run turtlebot3_teleop teleop_keyboard

     Control Your TurtleBot3!
     ---------------------------
     Moving around:
             w
        a    s    d
             x

     w/x : increase/decrease linear velocity (Burger : ~ 0.22, Waffle and Waffle Pi : ~ 0.26)
     a/d : increase/decrease angular velocity (Burger : ~ 2.84, Waffle and Waffle Pi : ~ 1.82)
     
     space key, s : force stop

     CTRL-C to quit

'w' pressed 15 times than a space. Motors rev up slowly

     currently:	linear velocity 0.01	 angular velocity 0.0 
     currently:	linear velocity 0.02	 angular velocity 0.0 
     currently:	linear velocity 0.03	 angular velocity 0.0 
     currently:	linear velocity 0.04	 angular velocity 0.0 
     currently:	linear velocity 0.05	 angular velocity 0.0 
     currently:	linear velocity 0.060000000000000005	 angular velocity 0.0 
     currently:	linear velocity 0.07	 angular velocity 0.0 
     currently:	linear velocity 0.08	 angular velocity 0.0 
     currently:	linear velocity 0.09	 angular velocity 0.0 
     currently:	linear velocity 0.09999999999999999	 angular velocity 0.0 
     currently:	linear velocity 0.10999999999999999	 angular velocity 0.0 
     currently:	linear velocity 0.11999999999999998	 angular velocity 0.0 
     currently:	linear velocity 0.12999999999999998	 angular velocity 0.0 
     currently:	linear velocity 0.13999999999999999	 angular velocity 0.0 
     currently:	linear velocity 0.0	 angular velocity 0.0

Explore

Create Node Graph

Terminal 3

Initialize the terminal

 eepp@hood:~$ rqt_graph

Bringup rosgraph.png

Source: Author

Bring up RVIZ

Terminal 3

Initialize the terminal

 eepp@hood:~$ ros2 launch turtlebot3_bringup rviz2.launch.py

Navigation 2 notes

terminal 1

 ros2 launch turtlebot3_bringup robot.launch.py

terminal 2

 ros2 launch turtlebot3_navigation2 navigation2.launch.py

Investigate Bringup Code

 eepp@hood:turtlebot3_ws$ emacs install/turtlebot3_bringup/share/turtlebot3_bringup/launch/robot.launch.py&