Skip to content

CMU-cabot/cabot-arduino

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: MIT

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 -m GT all                # build and upload (with -b arduino:avr:mega:cpu=atmega2560 -p /dev/ttyARDUINO_MEGA)
                                             # you can set board by ARDUINO_BOARD, and port by ARDUINO_PORT environment variables
					     # need to specify GT/GTM for PIN configuration

or use arduino-cli
docker $ arduino-cli compile -b arduino:avr:mega:cpu=atmega2560 -m GT .
docker $ arduino-cli upload -b arduino:avr:mega:cpu=atmega2560 -p /dev/ttyARDUINO_MEGA .
  • change -b <board type> -p <port> -m <mode> 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

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.