- Project Description
- Features
- Prerequisites
- Installation
- Usage
- Architecture
- Technologies Used
- Contributing
- Documentation
- License
This project simulates and controls a robotic arm using ROS2 Humble, Gazebo, and MoveIt2. The robotic arm is defined using URDF (Unified Robot Description Format) and is capable of executing planned trajectories within a simulated environment. The simulation integrates ROS2 control with MoveIt2 for advanced motion planning and trajectory execution. Additionally, the robotic arm is controlled using a camera and ArUco markers placed on the robot, workspace, and objects, enabling precise object pick and place operations through image processing and computer vision techniques.
- Simulation Environment: Realistic simulation using Gazebo.
- Motion Planning: Advanced trajectory planning with MoveIt2.
- Control Mechanism: Camera-based control using ArUco markers.
- Object Manipulation: Pick and place objects within the simulated workspace.
- Camera Calibration: Accurate camera setup for reliable image processing.
- Modular Design: Integration of Python and C++ for flexibility and performance.
- Operating System: Ubuntu 22.04
- ROS2 Distribution: ROS2 Humble
- Simulation Environment: Gazebo
- Motion Planning: MoveIt2
- Additional Tools:
meshlabfor mesh processing
-
Update Package Lists
sudo apt update && sudo apt install curl -y sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | sudo apt-key add - sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu $(lsb_release -cs) main" > /etc/apt/sources.list.d/ros2.list' sudo apt update
-
Install ROS2 Humble and Required Packages
sudo apt-get install -y \ libgeometric-shapes-dev \ meshlab \ ros-humble-diagnostic-updater \ ros-humble-gazebo-ros-pkgs \ ros-humble-gazebo-ros2-control \ ros-humble-joint-state-broadcaster \ ros-humble-joint-state-publisher \ ros-humble-joint-trajectory-controller \ ros-humble-moveit \ ros-humble-ros-base \ ros-humble-ros2-control \ ros-humble-ros2-controllers \ ros-humble-ros2bag \ ros-humble-rqt \ ros-humble-rqt-graph \ ros-humble-rviz2 \ ros-humble-tf2-tools \ ros-humble-xacro -
Clone the Repository
git clone https://github.com/ABMI-software/Robot5A-Simulation.git ~/Robot5A-Simulation -
Build the Workspace
cd ~/Robot5A-Simulation source /opt/ros/humble/setup.bash rosdep update rosdep install --from-paths src --ignore-src -r -y
colcon build
-
Source the Workspace
source install/setup.bash -
Export the settings
export QT_QPA_PLATFORM=xcb -
Write to bashrc for automatic export and source when launching the terminal
echo "source /opt/ros/humble/setup.bash" >> ~/.bashrc echo "source /usr/share/gazebo/setup.bash" >> ~/.bashrc echo "source ~/Robot5A-Simulation/install/setup.bash" >> ~/.bashrc echo "export QT_QPA_PLATFORM=xcb" >> ~/.bashrc
-
Build Clean
cd ~/Robot5A-Simulation rm -rf build install log source /opt/ros/humble/setup.bash colcon build --symlink-install --cmake-clean-cache
Alternatively, you may consider using Docker and the wrapper dosh.
-
Install docker
Follow its documentation.
-
Manage Docker as a non-root user
Follow its documentation.
sudo groupadd docker sudo usermod -aG docker $USER newgrp docker -
Install dosh
Follow its README.
git clone https://github.com/gportay/dosh.git ~/dosh cd ~/dosh make user-install
-
Run an interactive docker shell
dosh
-
Enter any commands from the shell
The commands are run in the container, with the user credential, the current directory bind mounted, and few other things (see doshrc). The image is based on the official docker image
ros:humble-ros-basefrom dockerhub, it is currently derived from Ubuntu Jammy (22.04).
Note: The run-command file .bashrc sources the necessary bits so it is unecessary to source the files /opt/ros/humble/setup.bash and install/setup.bash manually.
Start the Gazebo simulation environment with the robotic arm using MoveIt.
source /opt/ros/humble/setup.bash
source /usr/share/gazebo/setup.bash
source install/setup.bash
ros2 launch robot_control visual_sim.launch.py N.B. : It's also possible to control the arm using rviz2
The project is structured into several key components:
- URDF Definition: Defines the physical and visual properties of the robotic arm.
- ROS2 Control: Manages the hardware interfaces and controllers for joint movements.
- MoveIt2 Integration: Handles motion planning and trajectory execution.
- Gazebo Simulation: Provides a realistic environment for testing and development.
- Camera and ArUco Markers: Facilitates precise control and object tracking through computer vision.
- Python and C++ Nodes: Implements control logic, image processing, and communication between components.
- ROS2 Humble: Robot Operating System for middleware and communication.
- Gazebo: Simulation environment for robotics.
- MoveIt2: Motion planning framework.
- URDF: Robot description format.
- Python: Scripting and automation.
- C++: Performance-critical components.
- OpenCV: Image processing and computer vision.
- ArUco: Marker-based tracking.
Contributions are welcome! Please follow these steps:
-
Fork the Repository and fork it
Create a new fork.
-
Enter the sources
cd ~/Robot5A-Simulation
-
Create a Feature Branch
git checkout -b feature/YourFeature
-
Commit Your Changes
git commit -m "Add your feature" -
Push to the Branch
git push origin feature/YourFeature
-
Open a Pull Request
Open a pull request
All C++ nodes created under robot control package are documented using Doxygen check the docs/html/index.html for an interactive code docs
This project is licensed under the MIT License.
Developed by Eliott, Omar & Matthieu - ABMI Groupe
