Skip to content

sketch and resources to build up micro computers for cabot.

License

Notifications You must be signed in to change notification settings

CMU-cabot/cabot-arduino-ace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

CaBot Arduino Serial

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

Cabot-Arduino

This repository contains an Arduino project for CaBot, managaing sensors and the handle.

Usage

$ rosrun rosserial_python serial_node.py <parameters>

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 sensor
    • touch_threshold - if the value is below touch_base - touch_threshold then changes to touch state
    • release_threshold - After transitioning to touch state, the value bigger than touch_base - release_threshold then changes to release state
  • touch_threshold deprecated (int) - touch threshold
  • release_threshold deprecated - release threshold

Pre-requisites

Hardware

One example of hardware components

Software (docker, arduino-ide)

  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)

Software (Arduino IDE)

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

tips

  • rosserial 0.7.9 works with Arduino Mega 2560
  • rosserial 0.9.1 works with EPS32

Assembly instructions

The following figure explains the manner in which the touch sensor, push buttons and vibrators are supposed to be connected with Arduino Mega 2560.

Components description

  • 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.