Chapter1b 9_19_2022 Tsim ROS Robotics By Example 2nd (RRBE2) Alias foxy or noetic (Page 19) harman@harman-VirtualBox:~$ noetic ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions. harman@harman-VirtualBox:~$ roscore (Keep Terminal Activ Alias foxy or noetic harman@harman-VirtualBox:~$ noetic (New Terminal - Keep Active) ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions. harman@harman-VirtualBox:~$ rosrun turtle (Tab Completion) turtle_actionlib turtlesim turtle_tf turtle_tf2 harman@harman-VirtualBox:~$ rosrun turtlesim turtlesim_node (See the pretty Turtle RC-Always on top) [ INFO] [1663615980.661076819]: Starting turtlesim with node name /turtlesim [ INFO] [1663615980.665257478]: Spawning turtle [turtle1] at x=[5.544445], y=[5.544445], theta=[0.000000] Alias foxy or noetic (Pg 21) harman@harman-VirtualBox:~$ noetic (New Terminal) ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions. harman@harman-VirtualBox:~$ rosnode list /rosout /turtlesim harman@harman-VirtualBox:~$ rosnode info /turtlesim Node [/turtlesim] Publications: * /rosout [rosgraph_msgs/Log] * /turtle1/color_sensor [turtlesim/Color] * /turtle1/pose [turtlesim/Pose] Subscriptions: * /turtle1/cmd_vel [unknown type] Services: * /clear * /kill * /reset * /spawn * /turtle1/set_pen * /turtle1/teleport_absolute * /turtle1/teleport_relative * /turtlesim/get_loggers * /turtlesim/set_logger_level contacting node http://harman-VirtualBox:45939/ ... Pid: 6864 harman@harman-VirtualBox:~$ rqt_graph (Nodes and Topics PG 22) (SELECT Nodes/Topics (All) REFRESH ) TEXTBOOK PAGES 24-25 arman@harman-VirtualBox:~$ rostopic list /rosout /rosout_agg /turtle1/cmd_vel /turtle1/color_sensor /turtle1/pose harman@harman-VirtualBox:~$ rostopic type /turtle1/color_sensor turtlesim/Color harman@harman-VirtualBox:~$ rosmsg list | grep turtlesim turtlesim/Color turtlesim/Pose harman@harman-VirtualBox:~$ rosmsg show turtlesim/Color uint8 r uint8 g uint8 b harman@harman-VirtualBox:~$ rostopic echo /turtle1/color_sensor -n1 (Just 1) r: 69 g: 86 b: 255 --- SEE PAGE 26 RRBE2 FOR A SUMMARY TABLE LET'S MOVE THE TURTLE noetic/ roscore Term1 / noetic turtlesim_node active Term2 Terminal 3 noetic Alias foxy or noetic harman@harman-VirtualBox:~$ noetic ROS_DISTRO was set to 'foxy' before. Please make sure that the environment does not mix paths from different distributions. harman@harman-VirtualBox:~$ rostopic type /turtle1/cmd_vel geometry_msgs/Twist harman@harman-VirtualBox:~$ rosmsg show geometry_msgs/Twist geometry_msgs/Vector3 linear float64 x float64 y float64 z geometry_msgs/Vector3 angular float64 x float64 y float64 z harman@harman-VirtualBox:~$ rostopic pub /turtle1/cmd_vel geometry_msgs/Twist (Type this much and hit Tabs for the array - back up and set values) x: 0.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 0.0" x: 2.0 (One Shot) y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 1.8" publishing and latching message. Press ctrl-C to terminate harman@harman-VirtualBox:~$ rostopic pub -r 1 /turtle1/cmd_vel geometry_msgs/Twist "linear: x: 2.0 y: 0.0 z: 0.0 angular: x: 0.0 y: 0.0 z: 1.8" (And the Turtle goes Round and Round - 2m/s and 1.8 rad/sec) harman@harman-VirtualBox:~$ rosservice call /reset (Note new turtle) harman@harman-VirtualBox:~$ rosrun turtlesim turtle_teleop_key Reading from keyboard --------------------------- Use arrow keys to move the turtle. 'q' to quit. UP Forward/Down Back; Right Arrow (CW) Left Arrow (CCW) harman@harman-VirtualBox:~$ rosservice call /reset Parameters P 28-30 RRBE2 harman@harman-VirtualBox:~$ rosparam help rosparam is a command-line tool for getting, setting, and deleting parameters from the ROS Parameter Server. Commands: rosparam set set parameter rosparam get get parameter rosparam load load parameters from file rosparam dump dump parameters to file rosparam delete delete parameter rosparam list list parameter names ** Variation between Kinetic and Noetic harman@harman-VirtualBox:~$ rosparam list /rosdistro /roslaunch/uris/host_harman_virtualbox__46169 /rosversion /run_id /turtlesim/background_b (In Kinetic /background_b /turtlesim/background_g /turtlesim/background_r harman@harman-VirtualBox:~$ rosparam get / rosdistro: 'noetic ' roslaunch: uris: host_harman_virtualbox__46169: http://harman- VirtualBox:46169/ rosversion: '1.15.14 ' run_id: 2179c020-3858-11ed-aa75-5523731695eb turtlesim: background_b: 255 background_g: 86 background_r: 69 TURTLE IN THE RED harman@harman-VirtualBox:~$ rosparam set /turtlesim/background_b 0 harman@harman-VirtualBox:~$ rosparam set /turtlesim/background_g 0 harman@harman-VirtualBox:~$ rosparam set /turtlesim/background_r 255 harman@harman-VirtualBox:~$ rosservice call /clear (Vivid RED background) ROS SERVICES TO MOVE TURTLE (Pages 30-32) harman@harman-VirtualBox:~$ rostopic type /turtle1/pose turtlesim/Pose harman@harman-VirtualBox:~$ rosmsg show turtlesim/Pose float32 x float32 y float32 theta float32 linear_velocity float32 angular_velocity harman@harman-VirtualBox:~$ rostopic echo /turtle1/pose -n1 x: 5.544444561004639 y: 5.544444561004639 theta: 0.0 linear_velocity: 0.0 angular_velocity: 0.0 --- harman@harman-VirtualBox:~$ rosservice call /turtle1/teleport_absolute 1 1 0 (Move to 1,1) harman@harman-VirtualBox:~$ rosservice call /turtle1/teleport_relative 1 0 (Move to 2,1) harman@harman-VirtualBox:~$ rostopic echo /turtle1/pose -n1 x: 2.0 y: 1.0 theta: 0.0 linear_velocity: 0.0 angular_velocity: 0.0 ---