Skip to content

cactusdynamics/multi-robot-demo

Repository files navigation

Multi Robot ROS 2 demo

Troubleshooting

Cannot launch GUI apps

When running on Linux, GUI programs may not launch due to X access control problems with an error message like:

Authorization required, but no authorization protocol specified

In that case, run the following command on the host to fix it:

xhost +

RViz/GUI apps not visible with multiple monitors + fractional scaling + wayland

Disable fractional scaling to see the app.

Pairing bluetooth controller

  • Install bluez: sudo apt install bluez
  • bluetoothctl
  • scan on
  • pair <MAC ADDRESS>
  • trust <MAC ADDRESS>
  • connect <MAC ADDRESS>

Create 3 + Raspberry Pi 4 generic image cannot access USB0

Need to add the following into the /boot/firmware/config.txt to enable USB peripheral mode. Not sure if the second line is needed but it is in the image that Create 3 provides:

dtoverlay=dwc2,dr_mode=peripheral
dtoverlay=i2c-gpio,bus=3,i2c_gpio_delay_us=1,i2c_gpio_sda=4,i2c_gpio_scl=5

Then add modules-load=dwc2,g_ether into /boot/firmware/cmdline.txt.

Then add the following in /etc/netplan/40-usb0.yaml with 0600 permissions.

network:
    version: 2
    ethernets:
        # Barebone image may not have network manager.
        # renderer: NetworkManager
        usb0:
            addresses:
            - 192.168.186.3/24
            dhcp4: false

Then reboot.

Access Create 3 Web Server

Do it via SSH port-forwarding:

ssh -L 8080:192.168.186.2:80 [email protected]

Useful launch targets

Snellie

  • See snellie's URDF model: ros2 launch snellie_description snellie.launch.xml viz:=true publish_joint_state:=true
  • Teleop only: ros2 launch robot_motion teleop.launch.xml namespace:=snellie drivetrain_package:=snellie_drivetrain
  • Teleop only (unsafe): ros2 launch robot_motion teleop.launch.xml namespace:=snellie drivetrain_package:=snellie_drivetrain safe_mode:=false
    • Teleop viz on host computer: ros2 launch robot_motion teleop_snellie_viz.launch.xml
  • Mapping: ros2 launch robot_mapping mapping.launch.py namespace:=snellie
    • Mapping viz on host computer ros2 launch robot_mapping mapping_snellie_viz.launch.xml
    • Save map: MAP=default; ros2 run nav2_map_server map_saver_cli -f "$MAP" --ros-args -p map_subscribe_transient_local:=true -r __ns:=/snellie;ros2 service call /snellie/slam_toolbox/serialize_map slam_toolbox/srv/SerializePoseGraph "{'filename': '$MAP'}"
    • "
  • Localization (AMCL): ros2 launch robot_navigation localization.launch.xml namespace:=snellie map:=MAP_NAME.yaml
  • Localization (PoseGraph): ros2 launch robot_navigation slam_toolbox_localization.launch.py namespace:=snellie
  • Nav (host computer): ROS_DISCOVERY_SERVER=snellie.local:11811 ros2 launch robot_navigation nav2.launch.py namespace:=snellie map:=map/default.yaml
    • Nav viz on host computer ros2 launch robot_navigation nav_snellie_viz.launch.xml
  • Multi-robot nav viz: ros2 launch robot_navigation multirobot_viz.launch.xml active_robot:=snellie

Turtlebot4

  • Teleop only: ros2 launch robot_motion teleop.launch.xml namespace:=turtlebot4 drivetrain_package:=turtlebot4_drivetrain
    • Teleop viz on host computer: ros2 launch robot_motion teleop_turtlebot4_viz.launch.xml
  • Mapping: ros2 launch robot_mapping mapping.launch.py namespace:=turtlebot4
  • Mapping + teleop: ros2 launch robot_mapping mapping_teleop.launch.xml namespace:=turtlebot4
    • Mapping viz on host computer ros2 launch robot_mapping mapping_turtlebot4_viz.launch.xml
    • Save map: ros2 run nav2_map_server map_saver_cli -f "default" --ros-args -p map_subscribe_transient_local:=true -r __ns:=/turtlebot4
    • Save pose graph (will save to wherever mapping was run): MAP=default; ros2 run nav2_map_server map_saver_cli -f "$MAP" --ros-args -p map_subscribe_transient_local:=true -r __ns:=/turtlebot4;ros2 service call /turtlebot4/slam_toolbox/serialize_map slam_toolbox/srv/SerializePoseGraph "{'filename': '$MAP'}
  • Localization (AMCL): ros2 launch robot_navigation localization.launch.xml namespace:=turtlebot4 map:=map/default.yaml
  • Localization (PoseGraph): ros2 launch robot_navigation slam_toolbox_localization.launch.py namespace:=turtlebot4
  • Nav (on host computer): ROS_DISCOVERY_SERVER=turtlebot4.local:11811 ros2 launch robot_navigation nav2.launch.py namespace:=turtlebot4 map:=map/default.yaml
    • Nav viz on host computer ros2 launch robot_navigation nav_turtlebot4_viz.launch.xml
  • Multi-robot nav viz: ros2 launch robot_navigation multirobot_viz.launch.xml active_robot:=turtlebot4

Troubleshooting

  • Create 2 unresponsive (cmd_vel has data but robot is not driving despite connected): press dock and stop button at the same time for about 10s to reboot the roomba (there should be a jingle). The restart the create2remix which should cause a beep noise when it is enabled.

  • Create 3 needs to enable discovery service on the usb0's IP address as we have a split discovery service thing.

TODO

  • Republish TF tree into common.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •