Bringup
ros2 launch linorobot2_bringup bringup.launch.py micro_ros_transport:=udp4 micro_ros_port:=8888 lidar_transport:=udp_server lidar_server_port:=8889
Nav / SLAM
ros2 launch nav2_bringup navigation_launch.py
ros2 launch linorobot2_navigation navigation.launch.py map:=lab_map.yaml rviz:=true
ros2 launch slam_toolbox online_async_launch.py
ros2 launch linorobot2_navigation slam.launch.py rviz:=true
alias minniebot='ros2 launch linorobot2_bringup bringup.launch.py base_serial_port:=/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0 lidar_serial_port:=/dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-port0'
ros2 run nav2_map_server map_saver_cli -f <map_name> --ros-args -p save_map_timeout:=10000.
Rviz
ros2 run rviz2 rviz2 -d $(ros2 pkg prefix nav2_bringup)/share/nav2_bringup/rviz/nav2_default_view.rviz
Teleop
ros2 run teleop_twist_keyboard teleop_twist_keyboard
ros2 launch teleop_twist_joy teleop-launch.py joy_config:='xbox'
pkill -9 -f ros && ros2 daemon stop
export RMW_IMPLEMENTATION=rmw_zenoh_cpp
ros2 run rmw_zenoh_cpp rmw_zenohd
ros2 run demo_nodes_py listener
ros2 run demo_nodes_py talker
On other hosts, assuming zenoh router is running on 192.168.4.240 (Paul’s robot)
export ZENOH_CONFIG_OVERRIDE='mode="client";connect/endpoints=["tcp/192.168.4.240:7447"]'
References
Compete in DPRG indoor contests (6-can, 4-square)
Map the house
Wander around open spaces in the house
Teleop using phone
Reset/Restart Autonomy Layer or Motion Control Layer and system resumes operation
Stop Autonomy Layer and robot stops in safe state
Run Autonomy SW in simulation (for system test/dev purposes)
System cannot complete mission, so cancels it. (Examples: cannot escape bumper press, critically low battery)
Analyze logs & bags from runs, with visibility into all important aspects
System shall transport packets between Autonomy Layer and Motion Control Layer with integrity checking
System shall drop packets that fail checks
System design shall be tolerant of dropped packets (Hi-want)
System shall ramp wheel velocity to requested level at an achievable rate. Rationale: steps in motor power may produce perturbations.
System shall log important motion-control layer data to bag files
System shall provide realtime performance for motion control loops
System shall be based on the Linorobot2 stack with Thomas Chou's Linorobot2_hardware ESP32-Waveshare support. (Linorobot2 constraint based on minimizing ROS2 learning curve and getting earliest-possible working robot. Thomas Chou's fork of Linorobot2_hardware is based on him providing a good wiki that organizes bringup and gives a lot of ancilliary information).
Minniebot is an indoor robot based on a small inexpensive differential drive platform with brushed DC yellow TT motors with quadrature encoders. It runs the Linorobot ROS2 SW stack, which gives it SLAM and Nav2 capabilities. These support the use cases of DPRG contests and wandering around the house.
The Linorobot2 stack is an implementation of ROS2 on Raspberry Pi or PC and micro-ros on microcontrollers such as teensy and ESP32. It requires that an implementation have specific models of a spinning lidar and a depth camera (or that the builder provide compatible SW drivers). The lidar and depth camera are mounted on the platform, along with an RPi and the ESP32-based Waveshare General Robot Control board and other sensors.
LD19 lidar
Oak-D-Lite RGB-D camera
Front Bumper
Quadrature encoders
IMU
In Google sheet
RPi USB2 bottom port cabled to Waveshare serial port (left)
RPI USB3 bottom port cabled to Waveshare lidar port (right)
Use imager to install Ubuntu 24.04 LTS on SD card for Minniebot
Boot SD card in RPi to complete installation
From monitor: sudo apt update; sudo apt upgrade; sudo apt install ssh; sudo systemctl enable ssh; sudo systemctl status ssh. Now you can log into minniebot
Test that talker and listener can communicate when running on two ROS computers. Test in both directions. If there are problems, follow the Installation troubleshooting guide - this includes multicast tests. If there are still problems, test the abilty to send UDP packets between laptop & RPi:
computer 1: ros2 run demo_nodes_cpp talker
computer 2: ros2 run demo_nodes_cpp listener
If problems:
ros2 run multicast send/receive on the same and different computers, in each direction
If multicast fails, check that UDP works. UDP is foundational, and if it doesn't work, you've got firewall issues, or AP Isolation mode, or something networky
computer 1: nc -ul 1234 # listen on UDP port 1234
computer 2: echo hullo | nc -u <other IP> 1234
Related ufw firewall configuration commands
sudo ufw status
sudo ufw status numbered
sudo ufw delete 6
sudo ufw enable
sudo ufw allow in proto udp to 224.0.0.0/4
sudo ufw allow in proto udp from 224.0.0.0/4
sudo ufw allow in proto udp to 192.168.0.0/16
sudo ufw allow in proto udp from 192.168.0.0/16
Install nomachine from nomachine.com on both laptop and RPi. (You need an account.) Use the nomachine client on the laptop. The nomachine service is installed and runs from startup on the RPi and offers discovery to the client when run nomachine is run on the laptop. Be sure to disable the server on the laptop.
Follow instructions at https://github.com/hippo5329/micro_ros_arduino_examples_platformio/wiki#install-the-software-tools to install additional SW on RPi. Don't install platformIO (it runs too slow on an RPi, and way faster on the laptop). Do install ROS, but use the instructions at docs.ros.org
Install the following additional ros packages:
ros-<distro>-robot-localization
ros-<distro>-swri-console
ros-<distro>-plotjuggler, ros-<distro>-plotjuggler-ros
ros-<distro>-joint-state-publisher
ros-<distro>-nav2-route
ros-<distro>-xacro
python3-transforms3d
Build the micro-ros agent using the instructions at https://github.com/hippo5329/micro_ros_arduino_examples_platformio/wiki#build-micro-ros-agent
Install linorobot2 using these instructions: https://github.com/hippo5329/linorobot2_hardware/wiki#install-linorobot2
Right motor with red on +ve voltage drives fwd. Left motor with red on +ve drives backward
Motor gear ratio is 120:1. There are 8 encoder pulses per revolution, => 960 pulses per wheel revolution
Wheel diameter: 80mm, circumference: 251.3mm. => 0.261mm travel per encoder pulse
With V-in = 6.5V, wheels rotated 19-20 times in 8 sec => 150RPM. This is close to unloaded spec of 160RPM at 6V
At 150 RPM, motor would travel 0.63m/s
When bottom left USB on RPi is plugged into esp32, it's /dev/serial/by-path ID is platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.4:1.0-port0
When bottom right USB3 on RPi is plugged into lidar, it's /dev/serial/by-path ID is platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.2:1.0-port0
local_costmap:
local_costmap:
ros_parameters:
footprint: "[ [0.05, 0.09], [0.05, -0.09], [-0.09, -0.09], [-0.09, 0.09] ]"
global_costmap:
global_costmap:
ros_parameters:
robot_radius: 0.09