This project provides:
- ROS 2 Hardware interface,
- ROS 2 UMI Robot MoveIt package,
- and MicroROS ESP32 component for Servo control with a serial connection.
This project uses the UMI robot hardware designed by Murilo Marques Marinho, Ph.D. It's a low-cost 3D printable robotic platform. You can access the UMIRobot website here. UMIRobot is an excellent platform for both robotics enthusiasts and students.
MicroROS is a platform designed to bring ROS2 (Robot Operating System 2) to microcontrollers. This project uses a component for ESP-IDF (Espressif IoT Development Framework) that integrates MicroROS.
To set up MicroROS for this project, follow these steps:
- Clone the MicroROS for ESP-IDF component repository:
git clone https://github.com/BarisYazici/micro_ros_espidf_component.git
- Start the repository using the devcontainer for VSCode.
- Open the project in Visual Studio Code.
- Move the
.devcontainer
directory to the top level of your project. - Press
F1
to open the command palette, then run theDev Containers: Rebuild container
command.
- Source the ESP-IDF environment setup script. This script sets up the environment variables and paths necessary for the ESP-IDF. Depending on the shell you're using, the command might be:
source $IDF_PATH/export.sh
- Switch to the servo_drive example folder.
cd examples/servo_drive
- Build the example servo_drive project
idf.py build
- Connect the ESP32 to your laptop. And give read-write permission to the docker container user.
sudo chmod a+rw /dev/ttyUSB0
- Flash the ESP32 with the servo_drive example
idf.py flash
This project uses a development container in Visual Studio Code for a consistent and easily reproducible development environment.
- Ensure you have Docker installed and running on your machine.
- Install Visual Studio Code.
- Install the Remote - Containers extension in Visual Studio Code.
- Open the project in Visual Studio Code.
- Move the
.devcontainer
directory to the top level of your project. - Press
F1
to open the command palette, then run theDev Containers: Rebuild container
command.
This will build the Docker image as defined in the .devcontainer
directory and start a container. Your workspace will automatically be mounted into the container, and you'll be connected to the running container.
Once you're in the development container, you can create a ROS2 workspace:
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
To build the project,
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
Make sure that you connected the ESP32 through serial communication to your computer. Run the following docker container to connect the MicroROS agent.
docker run -it --rm --device=/dev/ttyUSB0 microros/micro-ros-agent:humble serial --dev /dev/ttyUSB0 -b 115200 -v6
After connecting the ROS 2 agent making sure that you can receive data from the Microros agent in ESP32 microcontroller, you can run the MoveIt example with the following command:
ros2 launch umi_robot_moveit_config demo.launch.py
This will start the RViz2 application with MoveIt motion plannning plugin.