mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-04 03:34:08 +05:30
Updated README.md
This commit is contained in:
parent
ad01b6ad55
commit
eaf6b422ad
41
README.md
41
README.md
@ -122,14 +122,14 @@ Bring up your copy of the params file (my\_arduino\_params.yaml) in
|
|||||||
your favorite text editor. It should start off looking like this:
|
your favorite text editor. It should start off looking like this:
|
||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
port: /dev/ttyACM0
|
port: /dev/ttyUSB0
|
||||||
baud: 57600
|
baud: 57600
|
||||||
timeout: 0.1
|
timeout: 0.1
|
||||||
|
|
||||||
rate: 50
|
rate: 50
|
||||||
sensorstate_rate: 10
|
sensorstate_rate: 10
|
||||||
|
|
||||||
use_base_controller: True
|
use_base_controller: False
|
||||||
base_controller_rate: 10
|
base_controller_rate: 10
|
||||||
|
|
||||||
# === Robot drivetrain parameters
|
# === Robot drivetrain parameters
|
||||||
@ -139,26 +139,26 @@ base_controller_rate: 10
|
|||||||
#gear_reduction: 1.0
|
#gear_reduction: 1.0
|
||||||
#motors_reversed: True
|
#motors_reversed: True
|
||||||
|
|
||||||
# === PID parameters
|
# === PID parameters
|
||||||
#Kp: 20
|
#Kp: 20
|
||||||
#Kd: 12
|
#Kd: 12
|
||||||
#Ki: 0
|
#Ki: 0
|
||||||
#Ko: 50
|
#Ko: 50
|
||||||
|
|
||||||
# === Sensor definitions. Examples only - edit for your robot.
|
# === Sensor definitions. Examples only - edit for your robot.
|
||||||
# Sensor type can be one of the follow (case sensitive!):
|
# Sensor type can be one of the follow (case sensitive!):
|
||||||
# Ping
|
# * Ping
|
||||||
# GP2D12
|
# * GP2D12
|
||||||
# Analog
|
# * Analog
|
||||||
# Digital
|
# * Digital
|
||||||
# PololuMotorCurrent
|
# * PololuMotorCurrent
|
||||||
|
|
||||||
sensors: {
|
sensors: {
|
||||||
motor_current_left: {pin: 0, type: PololuMotorCurrent, rate: 5},
|
#motor_current_left: {pin: 0, type: PololuMotorCurrent, rate: 5},
|
||||||
motor_current_right: {pin: 1, type: PololuMotorCurrent, rate: 5},
|
#motor_current_right: {pin: 1, type: PololuMotorCurrent, rate: 5},
|
||||||
ir_front_center: {pin: 2, type: GP2D12, rate: 10},
|
#ir_front_center: {pin: 2, type: GP2D12, rate: 10},
|
||||||
sonar_front_center: {pin: 5, type: Ping, rate: 10},
|
#sonar_front_center: {pin: 5, type: Ping, rate: 10},
|
||||||
arduino_led: {pin: 13, type: Digital, rate: 2, direction: output}
|
arduino_led: {pin: 13, type: Digital, rate: 5, direction: output}
|
||||||
}
|
}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
@ -168,8 +168,7 @@ Let's now look at each section of this file.
|
|||||||
|
|
||||||
_Port Settings_
|
_Port Settings_
|
||||||
|
|
||||||
The port will likely be either /dev/ttyACM0 or /dev/ttyUSB0 (e.g. for
|
The port will likely be either /dev/ttyACM0 or /dev/ttyUSB0. Set accordingly.
|
||||||
an Xbee connection). Set accordingly.
|
|
||||||
|
|
||||||
The MegaRobogaiaPololu Arudino sketch connects at 57600 baud by default.
|
The MegaRobogaiaPololu Arudino sketch connects at 57600 baud by default.
|
||||||
|
|
||||||
@ -184,6 +183,8 @@ The *sensorstate\_rate* determines how often to publish an aggregated
|
|||||||
list of all sensor readings. Each sensor also publishes on its own
|
list of all sensor readings. Each sensor also publishes on its own
|
||||||
topic and rate.
|
topic and rate.
|
||||||
|
|
||||||
|
The *use\_base\_controller* parameter is set to False by default. Set it to True to use base control (assuming you have the required hardware.) You will also have to set the PID paramters that follow.
|
||||||
|
|
||||||
The *base\_controller\_rate* determines how often to publish odometry readings.
|
The *base\_controller\_rate* determines how often to publish odometry readings.
|
||||||
|
|
||||||
_Defining Sensors_
|
_Defining Sensors_
|
||||||
@ -234,10 +235,10 @@ You should see something like the following output:
|
|||||||
|
|
||||||
<pre>
|
<pre>
|
||||||
process[arduino-1]: started with pid [6098]
|
process[arduino-1]: started with pid [6098]
|
||||||
Connecting to Arduino on port /dev/ttyACM0 ...
|
Connecting to Arduino on port /dev/ttyUSB0 ...
|
||||||
Connected at 57600
|
Connected at 57600
|
||||||
Arduino is ready.
|
Arduino is ready.
|
||||||
[INFO] [WallTime: 1355498525.954491] Connected to Arduino on port /dev/ttyACM0 at 57600 baud
|
[INFO] [WallTime: 1355498525.954491] Connected to Arduino on port /dev/ttyUSB0 at 57600 baud
|
||||||
[INFO] [WallTime: 1355498525.966825] motor_current_right {'rate': 5, 'type': 'PololuMotorCurrent', 'pin': 1}
|
[INFO] [WallTime: 1355498525.966825] motor_current_right {'rate': 5, 'type': 'PololuMotorCurrent', 'pin': 1}
|
||||||
[INFO]
|
[INFO]
|
||||||
etc
|
etc
|
||||||
@ -251,7 +252,7 @@ Viewing Sensor Data
|
|||||||
-------------------
|
-------------------
|
||||||
To see the aggregated sensor data, echo the sensor state topic:
|
To see the aggregated sensor data, echo the sensor state topic:
|
||||||
|
|
||||||
$ rostopic echo /arduino/sensors
|
$ rostopic echo /arduino/sensor_state
|
||||||
|
|
||||||
To see the data on any particular sensor, echo its topic name:
|
To see the data on any particular sensor, echo its topic name:
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user