This is a fork version of cabot-arduino which communicates with CaBot's Arduino board with a raw serial connection instead of using rosserial library.
- We will migrate CaBot from ROS to ROS2
- ROS2 does not support rosserial
- ROS2 offers microROS but Arduino MEGA is not supported (need more RAM)
So, we decided to use raw serial connection between PC and Arduino board and wrap it for ROS and ROS2.
copy of the original description
This repository contains an Arduino project for CaBot, managaing sensors and the handle.
$ rosrun rosserial_python serial_node.py <parameters>
- calibration_params :
int[22]
- BNO055 calibration parameter. Follow instruction when you not specify this parameter.
- touch_params : [
touch_base (int)
,touch_threshold (int)
,release_threshold (int)
]- Touch threshold parameters
touch_base
- base value when you don't touch the touch sensortouch_threshold
- if the value is belowtouch_base - touch_threshold
then changes to touch staterelease_threshold
- After transitioning to touch state, the value bigger thantouch_base - release_threshold
then changes to release state
touch_thresholddeprecated (int) - touch thresholdrelease_thresholddeprecated - release threshold
One example of hardware components
- 3D print parts
- Arduino Mega 2560 or ESP32 (beta)
- MPR121 capacitive touch sensor
- BNG055 9-axis IMU
- BMP280 Barometric Pressure & Altitude Sensor
- PCB shield example
- This Arduino shield is derived from an earlier project. It includes motor controllers, but here we will use it for IMU and touch sensor (does not include barometric pressure sensor part)
- 4 push buttons
- 3 mini disc vibrators
- Conductive Material (ex. Copper foil tape)
- Wires and headers
host $ docker-compose build
host $ docker-compose run arduino
docker $ ./build.sh all # build and upload (with -b esp32:esp32:esp32 -p /dev/ttyESP32)
# you can set board by ARDUINO_BOARD, and port by ARDUINO_PORT environment variables
or use arduino-cli
docker $ arduino-cli compile -b esp32:esp32:esp32 .
docker $ arduino-cli upload -b esp32:esp32:esp32 -p /dev/ttyESP32 .
- change
-b <board type> -p <port>
for your environment - linux is required to upload built sketch (Windows/Mac docker container does not support)
In order to run ROS on Arduino Mega 2560, you will need both the Arduino IDE as well as ROS Serial Arduino Library. Please follow the instructions on the following page for installing these requirements: Installation instructions
After installing Arduino IDE, please make sure to open the IDE at least once before proceeding to the next steps.
The following packages are essential for letting the touch sensor, push buttons and vibrator communicate with Arduino Mega 2560. Please open a new terminal and copy-paste the following instructions:
cd ~/Arduino/libraries
git clone https://github.com/adafruit/Adafruit_BNO055.git
git clone https://github.com/adafruit/Adafruit_Sensor.git
git clone https://github.com/adafruit/Adafruit_ADXL343.git
git clone https://github.com/adafruit/Adafruit_MPR121.git
git clone https://github.com/adafruit/Adafruit_BMP280.git
git clone https://github.com/contrem/arduino-timer
git clone https://github.com/frankjoshua/rosserial_arduino_lib.git
rosrun rosserial_arduino make_libraries.py ~/Arduino
- rosserial 0.7.9 works with Arduino Mega 2560
- rosserial 0.9.1 works with EPS32
The following figure explains the manner in which the touch sensor, push buttons and vibrators are supposed to be connected with Arduino Mega 2560.
- The Cabot's handle has three main features namely, touch sensor, push buttons (four of them), and vibrators (three of them).
- The touch sensor is used for giving user feedback to the robot while it is moving, to ensure that the robot moves along with the user without getting lost.
- The three vibrators are useful for giving alerts to the user in response to obstacles encountered in the front and on the sides of the robot while it is moving. They also provide alerts/ warnings to the user about upcoming left turns and right turns.
- The four push butons are useful for giving manual input signals to the robot, to command it to move in preferred directions (forward, backward, left turn, and right turn).
- The touch sensor is usually connected to a conductive material like copper film, or copper plate.