Skip to content
/ CARBI Public

CARBI is a mecanum mobile robot equipped with an RPLidar mounted on top. In its current phase, CARBI can generate 2D maps using the RPLidar in conjunction with the slam_toolbox and navigate to specified points (go-to-goal).

Notifications You must be signed in to change notification settings

HBBEEP/CARBI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

54 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

CARBI mecanum mobile robot

πŸ“– Description

CARBI is a mecanum mobile robot equipped with an RPLidar mounted on top. In its current phase, CARBI can generate 2D maps using the RPLidar in conjunction with the slam_toolbox and navigate to specified points (go-to-goal). However, a persistent issue is the inaccurate yaw orientation of CARBI due to slippage of the mecanum wheels during turning, affecting the calculation of wheel odometry. Additional problems will be discussed in this section πŸ”΄ Problem

πŸ‘ Members

This project is a part of the FRA532 Mobile robotics course. Our team includes:

  1. Kullakant Kaewkallaya 64340500006 @hbbeep
  2. Thamakorn Tongyod 64340500028 @TheGot

⚑ Component

  • Single board computer (Master) : Raspberry Pi5+Active Cooler
  • Microcontroller (Slave) : ESP32 36Pin+shield
  • Step down : DC to DC 24V to 5V 5A
  • Motor Drive : MDD10A Cytron
  • Motor : Motor 24V 50 rpm
  • IMU : mpu9250
  • Lidar : rplidar A1M8-R6
  • Encoder : AMT103-V

πŸ’» Controller

The CARBI Controller manages the operation of motors to enable the robot to move in specified directions and at set speeds. It is divided into two main parts the ROS Node and the ESP32 Controller, which communicate via Serial communication.

ROS Node

The ROS Node converts commands and sends data through Serial to the ESP32 microcontroller, as well as reading the speed of each wheel.

image

Node subscriber:

  • /cmd_vel: Sets the speed of each wheel.
  • /Emergency: Controls the emergency stop of the robot.

Node publisher:

  • /wheel_vel: Publishes the speed of each wheel.

Serial communication:

  • Motor command: Instructs the ESP32 to control each motor to operate at the specified speed.

    Serial format:

    <v,velocity_motorA,velocity_motorB,velocity_motorC,velocity_motorD>
  • Sensor callback: Data read from sensors sent by the ESP32.

    Serial format

    sensor1,sensor2,sensor3,sensor4

Functions:

  • set_velocity_cmd: Converts the cmd_vel values (Twist) into the specified format to send to the ESP32.
  • serial_wheel_cmd: Sends data through Serial to the ESP32.
  • Emergency_control: Manages the emergency state by instructing the ESP32 to stop when this function is triggered.
  • Serial_read: Receives data sent from the ESP32 via Serial and publishes the values.

ESP32 Controller

The ESP32 Controller operates on the microcontroller, sending and receiving commands and data through Serial. It controls motor speed and reads raw data from the Encoder to convert into speed.

image

Functions:

  • serial_read: Reads Serial data sent from the ROS Node.
  • parse_data: Parses the received message and categorizes the data.
  • state_control: Processes the parsed data according to the specified mode and sets the target values.
  • PID: Controls the motor speed to maintain the specified target speed.
  • motor_drive: Supplies power to the motor in the form of PWM.
  • motor_velocity_callback: Reads values from the encoder and converts them into speed in rad.
  • serial_write: Formats and sends the motor speed data through Serial.

Node Run

ros2 run carbi_controller controller.py

πŸš— Wheel odometry of mecanum

Forward Kinematics :

Screenshot 2024-06-03 015238

Inverse Kinematics :

Screenshot 2024-06-03 015245

When :

Screenshot 2024-06-03 015431

reference : https://cdn.intechopen.com/pdfs/465/InTechOmnidirectional_mobile_robot_design_and_implementation.pdf

βš“ TF

Here is the TF of the robot

Screenshot from 2024-06-03 13-39-53


βš™οΈ Installation

0. Clone this repo to your folder and CARBI will be your workspace (in both Raspberry Pi 5 & your computer)

git clone https://github.com/HBBEEP/CARBI.git

1. Config docker-compose.yml file (In both Raspberry Pi 5 & your computer)

docker_yml

  • For Raspberry Pi 5, there is no need to edit this section. However, if you change the workspace name or move it to another folder, you should update it accordingly.
  • Edit name in volumes section
 - /home/[path to CARBI workspace]/ros:/home/ros 
 - /home/[path to CARBI workspace]/CARBI:/ros2
  • Example:
    - /home/hbbeep/CARBI:/ros2 (hbbeep is my computer name)
    - /home/hbbeep/CARBI:/ros2
    

(but, in this repo, you can see that I named my workspace CARBI-1.)

2. Set Up CARBI environment with Docker (your computer)

cd ~/CARBI-1/docker
docker compose build # If docker environment is not built
docker compose up -d
docker exec -it docker-ros2-1 bash

then RUN this command in root

cd ros2/carbi
  • Then your terminal should look like this

computer_terminal

Note: If you are not familiar with Docker, please follow this tutorial (which I followed too :) )

3. remote to Raspberry Pi 5 by using SSH and then repeat step 3

ssh carbi@[IPv4 of raspberry pi 5]  # example -> ssh carbi@99.9.999.99
  • Then your terminal should look like this

rpi5_terminal

Note:

  1. Don't forget to connect internet in Raspberry Pi 5
  2. You can check the IPv4 address of Raspberry Pi 5 by using some tools like advance IP scanner program.

4. Clone this rplidar repo to your workspace (remote to Raspberry Pi 5)

git clone https://github.com/babakhani/rplidar_ros2

Note: before running Rviz2, run this command in your terminal to allow root access to the X server (your computer)

xhost local:root

πŸ“‘ Teleop

teleop_demo_1.mp4

Terminal 1 (remote to Raspberry Pi 5)

ros2 launch carbi_bridge carbi.launch.py

Terminal 2 (remote to Raspberry Pi 5)

ros2 run carbi_control carbi_controller.py

Terminal 3 (your computer or remote to Raspberry Pi 5 )

ros2 run teleop_twist_keyboard teleop_twist_keyboard

Mapping

mapping_1.mp4

Terminal 1 (remote to Raspberry Pi 5)

ros2 launch carbi_bridge carbi.launch.py

Terminal 2 (remote to Raspberry Pi 5)

ros2 run carbi_control carbi_controller.py

Terminal 3 (your computer)

ros2 run teleop_twist_keyboard teleop_twist_keyboard

Terminal 4 (your computer)

ros2 launch carbi_navigation mapping.launch.py

Note : if map doesn't show -> change Durability Policy topic to Trasient Local

fix_map

πŸ’‘ Navigation (go to goal)

navigation_1.mp4

Terminal 1 (remote to Raspberry Pi 5)

ros2 launch carbi_bridge carbi.launch.py

Terminal 2 (remote to Raspberry Pi 5)

ros2 run carbi_control carbi_controller.py

Terminal 3 (your computer)

ros2 launch carbi_navigation navigation.launch.py

Terminal 4 (your computer)

ros2 launch carbi_navigation justdisplay.launch.py 

🚩 Demo

Teleop

teleop_demo_1.mp4

Go to Goal

go_to_goal_demo.mp4

global cost map

global_cost_map

local cost map

local_cost_map


πŸ”΄ Problem

  1. Mecanum wheels slip excessively on smooth and slippery surfaces, causing incorrect wheel odometry.
  2. Due to the static attachment between the wheels and chassis, some wheels float when running on an uneven floor, causing both the linear and angular velocity of the robot to not match the commanded values.
  3. The Raspberry Pi loses some values when simultaneously reading from the USB serial and the RPLIDAR, leading to inaccurate wheel velocity readings during that time.

About

CARBI is a mecanum mobile robot equipped with an RPLidar mounted on top. In its current phase, CARBI can generate 2D maps using the RPLidar in conjunction with the slam_toolbox and navigate to specified points (go-to-goal).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published