ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Alternative using python directly
I now stopped working on rosserial and implemented an own python based interface:
#!/usr/bin/env python
import rospy
from std_msgs.msg import String
import serial
import time
ser = serial.Serial('/dev/ttyACM0', 115200)
pub = rospy.Publisher('chatter', String)
rospy.init_node('talker')
while 1:
a = ser.readline()
pub.publish(String(a))
If I have an arduino loop of
void loop() {
Serial.println("OFF");
}
the frequency is enough for my needs:
rostopic hz chatter
gives be above 10kHz.