mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-03 11:14:08 +05:30
Updated README file to include instructions on setting permissions on the serial port
This commit is contained in:
parent
d9d0c8b2a8
commit
e0fcbbfec8
45
README.md
45
README.md
@ -29,7 +29,7 @@ Official ROS Documentation
|
||||
--------------------------
|
||||
A standard ROS-style version of this documentation can be found on the ROS wiki at:
|
||||
|
||||
http://www.ros.org/wiki/ros_arduino_bridge
|
||||
http://www.ros.org/wiki/ros\_arduino\_bridge
|
||||
|
||||
|
||||
System Requirements
|
||||
@ -54,13 +54,46 @@ sketchbook/libraries directory.
|
||||
Finally, it is assumed you are using version 1.0 or greater of the
|
||||
Arduino IDE.
|
||||
|
||||
Preparing your Serial Port under Linux
|
||||
--------------------------------------
|
||||
Your Arduino will likely connect to your Linux computer as port /dev/ttyACM# or /dev/ttyUSB# where # is a number like 0, 1, 2, etc., depending on how many other devices are connected. The easiest way to make the determination is to unplug all other USB devices, plug in your Arduino, then run the command:
|
||||
|
||||
Installation
|
||||
------------
|
||||
$ ls /dev/ttyACM*
|
||||
|
||||
or
|
||||
|
||||
$ ls /dev/ttyUSB*
|
||||
|
||||
Hopefully, one of these two commands will return the result you're looking for (e.g. /dev/ttyACM0) and the other will return the error "No such file or directory".
|
||||
|
||||
Next you need to make sure you have read/write access to the port. Assuming your Arduino is connected on /dev/ttyACM0, run the command:
|
||||
|
||||
$ ls -l /dev/ttyACM0
|
||||
|
||||
and you should see an output similar to the following:
|
||||
|
||||
crw-rw---- 1 root dialout 166, 0 2013-02-24 08:31 /dev/ttyACM0
|
||||
|
||||
Note that only root and the "dialout" group have read/write access. Therefore, you need to be a member of the dialout group. You only have to do this once and it should then work for all USB devices you plug in later on.
|
||||
|
||||
To add yourself to the dialout group, run the command:
|
||||
|
||||
$ sudo usermod -a -G dialout your\_user\_name
|
||||
|
||||
where your\_user\_name is your Linux login name. You will likely have to log out of your X-window session then log in again, or simply reboot your machine if you want to be sure.
|
||||
|
||||
When you log back in again, try the command:
|
||||
|
||||
$ groups
|
||||
|
||||
and you should see a list of groups you belong to including dialout.
|
||||
|
||||
Installation of the ros\_arduino\_bridge Stack
|
||||
----------------------------------------------
|
||||
|
||||
$ cd ~/ros_workspace
|
||||
$ git clone https://github.com/hbrobotics/ros_arduino_bridge.git
|
||||
$ cd ros_arduino_bridge
|
||||
$ git clone https://github.com/hbrobotics/ros\_arduino\_bridge.git
|
||||
$ cd ros\_arduino\_bridge
|
||||
$ rosmake
|
||||
|
||||
The provided Arduino library is called ROSArduinoBridge and is
|
||||
@ -122,6 +155,8 @@ Firmware Commands
|
||||
-----------------
|
||||
The ROSArduinoLibrary accepts single-letter commands over the serial port for polling sensors, controlling servos, driving the robot, and reading encoders. These commands can be sent to the Arduino over any serial interface, including the Serial Monitor in the Arduino IDE.
|
||||
|
||||
**NOTE:** Before trying these commands, set the Serial Monitor baudrate to 57600 and the line terminator to "Carriage return" or "Both NL & CR" using the two pulldown menus on the lower right of the Serial Monitor window.
|
||||
|
||||
The list of commands can be found in the file commands.h. The current list includes:
|
||||
|
||||
<pre>
|
||||
|
@ -25,7 +25,7 @@ import thread
|
||||
from math import pi as PI, degrees, radians
|
||||
import os
|
||||
import time
|
||||
import sys
|
||||
import sys, traceback
|
||||
from serial.serialutil import SerialException
|
||||
from serial import Serial
|
||||
|
||||
@ -75,8 +75,11 @@ class Arduino:
|
||||
print "Arduino is ready."
|
||||
|
||||
except SerialException:
|
||||
print "Serial Exception:"
|
||||
print sys.exc_info()
|
||||
print "Traceback follows:"
|
||||
traceback.print_exc(file=sys.stdout)
|
||||
print "Cannot connect to Arduino!"
|
||||
print "Make sure you are plugged in and turned on."
|
||||
os._exit(1)
|
||||
|
||||
def open(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user