ROS interface package for converting the output of /rb_drive/rb_drive/twist_cmd
to a motor controller command and sending it to an L2Bot.
Contents (details below):
- Setup a ROS workspace
- Install Arduino IDE and ROS support
- Clone this repo into your workspace
- Upload the motor controller sketch to the Arduino
- Point the ROS node to your board
If you haven't already, create a catkin workspace.
$ mkdir -p ~/l2bot_ws/src
$ cd ~/l2bot_ws/src
- Download and install the Arduino IDE.
- Open the IDE and close it once it has finished launching. (This creates all the scketchbook directories on your system)
- Add serial write permissions. Run
sudo usermod -a -G dialout <UNAME>
where<UNAME>
is your username. - Restart Computer
- Install ROS Support (see below)
Make sure to replace indigo
with kinetic
when executing commands. For example, if the pages says to run the command
sudo apt-get install ros-indigo-rosserial-arduino
then you should run the command
sudo apt-get install ros-kinetic-rosserial-arduino
Clone this repository into the src
directory.
~/l2bot_ws/src$ git clone https://github.com/LTU-AutoEV/l2bot.git
Run catkin_make
from the workspace directory.
~/l2bot_ws/src$ cd ..
~/l2bot_ws$ catkin_make
~/l2bot_ws$ source devel/setup.bash
Install dependencies
~/l2bot_ws$ rosdep install --from-paths src --ignore-src -r -y
- Open the Arduino IDE
- File > Open
- Open the file
L2Bot_MC.ino
located at~/l2bot_ws/src/arduino/L2Bot_MC/
- Plug in the Arduino and turn on the L2Bot
- Tools -> Port -> (Select your arduino device)
- Upload to arduino
- Plug in your Arduino and turn on the L2Bot
- Execute the
detect_arduino.py
script
l2bot_ws/src/l2bot$ ./detect_arduino.py
std_msgs::UInt16
on /L2Bot/mc: Motor controller instruction for the l2bot