This stack contains packages related to environment mapping and autonomous navigation, such as:
- hoverboard_driver_hestia
- utbots_nav
cd <ros2_ws>/src
git clone https://github.com/UtBotsAtHome-UTFPR/utbots_navigation.git
git checkout ros2-dev
cd ../
This stacks utilizes rplidar_ros as the LIDAR driver and navigation2 for navigation and mapping algorithms integration to ROS2. Install them with:
sudo apt install ros-humble-rplidar-ros ros-humble-navigation2
For the MPU6050 IMU integration, you must install and setup microROS:
# Source the ROS 2 installation
source /opt/ros/$ROS_DISTRO/setup.bash
# Download the micro-ROS tools
cd <ros2_ws>
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
# Update dependencies
sudo apt update && rosdep update
rosdep install --from-paths src --ignore-src -y
# Build micro-ROS tools and source them
colcon build
source install/local_setup.bash
# Download and build micro-ROS-Agent packages
ros2 run micro_ros_setup create_agent_ws.sh
ros2 run micro_ros_setup build_agent.sh
source install/local_setup.bash
cd <ros2_ws>
colcon buiild --symlink-install
export BASE_MODEL=hestia
ros2 launch utbots_nav map.launch.py ## Launch all mapping packages (Gmapping)
ros2 launch utbots_nav nav.launch.py ## Launch all navigation packages (AMCL)
You can change the robot tf in ./hoverboard-driver-hestia/description/urdf/diffbot_description.urdf.xacro
, the navigation parameters in ./utbots_nav/param/hestia_nav.yaml
and mapping parameters in ./utbots_nav/param/hestia_map.yaml
.
- ROS2 Driver for RPLidar sensors
sudo apt install ros-humble-rplidar-ros
We use RPLIDAR A1:
sudo chmod 777 /dev/ttyUSB0
ros2 launch rplidar_ros view_rplidar_a1_launch.py
- Navigation and mapping algorithms integration to ROS2
sudo apt install ros-humble-navigation2
TODO: How to run basic nav2?
Refer to the tutorial on microROS with ESP32 and PlatformIO IDE.
- ESP32 board .cpp code for MPU6050 IMU read through I2C port and serial communication with ROS2 using the microROS package
Connect the MPU6050 board pins like the following: VCC to 3.3V, GND to GND, SCL to G22 and SDA to G21.
Flash the firmware in mpu6050driver/src/main.cpp
to the board, e.g. using the PlatformIO interface in VSCode with the .ini file, selecting the the port and run the following:
ros2 run micro_ros_agent micro_ros_agent serial --dev <port>
You should see a topic called /imu_info_topic
in ros2 topic list
.