Hood NUC Melih Gazebo Install
From wikidb
Contents
Context
January 17, 2020
Reference
- Intel TB3 Tutorial: The Melih tutorial instructions.
See Melih's tutorial section "Gazebo Simulator and ROS2-Gazebo Installation"
Install
eepp@hood:ros2_ws$ sudo apt install ros-dashing-ros-core ros-dashing-geometry* [sudo] password for eepp: Reading package lists... Done Building dependency tree Reading state information... Done Note, selecting 'ros-dashing-geometry-msgs' for glob 'ros-dashing-geometry*' Note, selecting 'ros-dashing-geometry-msgs-dbgsym' for glob 'ros-dashing-geometry*' ros-dashing-geometry-msgs is already the newest version (0.7.0-1bionic.20191210.233228). ros-dashing-geometry-msgs set to manually installed. ros-dashing-ros-core is already the newest version (0.7.3-1bionic.20191212.195334). ros-dashing-ros-core set to manually installed. The following packages were automatically installed and are no longer required: libllvm7 libllvm8 Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: ros-dashing-geometry-msgs-dbgsym 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded. Need to get 20.5 MB of archives. After this operation, 25.5 MB of additional disk space will be used. Do you want to continue? [Y/n] Y Get:1 http://packages.ros.org/ros2/ubuntu bionic/main amd64 ros-dashing-geometry-msgs-dbgsym amd64 0.7.0-1bionic.20191210.233228 [20.5 MB] Fetched 20.5 MB in 4s (4,769 kB/s) Selecting previously unselected package ros-dashing-geometry-msgs-dbgsym. (Reading database ... 275909 files and directories currently installed.) Preparing to unpack .../ros-dashing-geometry-msgs-dbgsym_0.7.0-1bionic.20191210.233228_amd64.deb ... Unpacking ros-dashing-geometry-msgs-dbgsym (0.7.0-1bionic.20191210.233228) ... Setting up ros-dashing-geometry-msgs-dbgsym (0.7.0-1bionic.20191210.233228) ...
Test 1
This simple bring-up test does not work
eepp@hood:ros2_ws$ gazebo --verbose /opt/ros/dashing/share/gazebo_plugins/worlds/gazebo_ros_diff_drive_demo.world Gazebo multi-robot simulator, version 9.11.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org [Msg] Waiting for master. Gazebo multi-robot simulator, version 9.11.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org [Msg] Waiting for master. [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 10.0.0.111 [INFO] [1579288600.726571176] [gazebo_ros_node]: ROS was initialized without arguments. [WARN] [1579288600.727818572] [rcl]: Found remap rule 'cmd_vel:=cmd_demo'. This syntax is deprecated. Use '--ros-args --remap cmd_vel:=cmd_demo' instead. [WARN] [1579288600.727867073] [rcl]: Found remap rule 'odom:=odom_demo'. This syntax is deprecated. Use '--ros-args --remap odom:=odom_demo' instead. [Err] [Connection.cc:546] Connection[0] Closed during Read [Err] [ConnectionManager.cc:141] Unable to read from master
Doesn't come up. The following doesn't help because it sets up RoS 2 for the environment built from source. Gazebo was not
eepp@hood:ros2_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.
Test 2
Mostly passes: Notice the setup.bash scripts in each terminal. They reference different ROS 2 installs: binary and from source. Gazebo doesn't work otherwise. Troubling. This must have to do with the binary install using apt.
Terminal 1
eepp@hood:~$ source /opt/ros/dashing/setup.bash eepp@hood:~$ gazebo --verbose /opt/ros/dashing/share/gazebo_plugins/worlds/gazebo_ros_diff_drive_demo.world Gazebo multi-robot simulator, version 9.11.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org [Msg] Waiting for master. Gazebo multi-robot simulator, version 9.11.0 Copyright (C) 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org [Msg] Waiting for master. [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 10.0.0.111 [INFO] [gazebo_ros_node]: ROS was initialized without arguments. [INFO] [demo.diff_drive]: Wheel pair 1 separation set to [1.250000m] [INFO] [demo.diff_drive]: Wheel pair 1 diameter set to [0.600000m] [INFO] [demo.diff_drive]: Subscribed to [/demo/cmd_demo] [INFO] [demo.diff_drive]: Advertise odometry on [/demo/odom_demo] [INFO] [demo.diff_drive]: Publishing odom transforms between [odom_demo] and [chassis] [INFO] [demo.diff_drive]: Publishing wheel transforms between [chassis], [left_wheel_joint] and [right_wheel_joint] [Msg] Connected to gazebo master @ http://127.0.0.1:11345 [Msg] Publicized address: 10.0.0.111 ^C[INFO] [rclcpp]: signal_handler(signal_value=2)
Terminal 2
eepp@hood:~$ source ~/ros2_all_ws/ros2_ws/install/local_setup.bash eepp@hood:~$ ros2 topic pub /demo/cmd_demo 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 /demo/cmd_demo 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))