mirror of
https://github.com/YikeStone/ros_arduino_bridge.git
synced 2025-08-03 19:24:09 +05:30
Fixed bug in arduino_node.py changing aggregate topic name from sensors to sensor_state
This commit is contained in:
parent
a1a87116f5
commit
ad01b6ad55
@ -219,9 +219,9 @@ int runCommand() {
|
|||||||
|
|
||||||
#ifdef USE_BASE
|
#ifdef USE_BASE
|
||||||
case READ_ENCODERS:
|
case READ_ENCODERS:
|
||||||
Serial.print(readEncoder(0));
|
Serial.print(readEncoder(LEFT));
|
||||||
Serial.print(" ");
|
Serial.print(" ");
|
||||||
Serial.println(readEncoder(1));
|
Serial.println(readEncoder(RIGHT));
|
||||||
break;
|
break;
|
||||||
case RESET_ENCODERS:
|
case RESET_ENCODERS:
|
||||||
resetEncoders();
|
resetEncoders();
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
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
|
||||||
@ -30,9 +30,9 @@ base_controller_rate: 10
|
|||||||
# * 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}
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ class ArduinoROS():
|
|||||||
|
|
||||||
# The SensorState publisher periodically publishes the values of all sensors on
|
# The SensorState publisher periodically publishes the values of all sensors on
|
||||||
# a single topic.
|
# a single topic.
|
||||||
self.sensorStatePub = rospy.Publisher('~sensors', SensorState)
|
self.sensorStatePub = rospy.Publisher('~sensor_state', SensorState)
|
||||||
|
|
||||||
# A service to position a PWM servo
|
# A service to position a PWM servo
|
||||||
rospy.Service('~servo_write', ServoWrite, self.ServoWriteHandler)
|
rospy.Service('~servo_write', ServoWrite, self.ServoWriteHandler)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user