ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to use rosserial_python?

asked 2016-01-31 19:16:10 -0600

sonictl gravatar image

how to use rosserial? How to use rosserial_python.

My task is writing a ROS node(python) to send command and receive status code from my mcu(had been programmed). through serial port(/dev/ttyUSB0, 9600)

I noticed that rosserial package is only working for "a connected rosserial-enabled device". Is that true?

How can I finish my task using the package"rosserial"? if can not, what is the most efficient way to achive that?

Thank you very much!!!!!

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2016-02-01 23:35:45 -0600

sonictl gravatar image

updated 2016-02-02 00:25:39 -0600

my blog described several ways about ROS-Serial communication. I Pasted how to build a ros_node to do the "implement your own code in the node to translate the messages from the mcu into appropriate messages for ros topics, and subscribe to appropriate topics in ros and convert that data into appropriate messages for your mcu" as nickw said.

edit flag offensive delete link more
1

answered 2016-02-01 03:18:13 -0600

rosserial is used with mcus that have rosserial code running on them. As you already have a different protocol on your mcu (you describe it as programmed already, I am assuming that it is not running rosserial code) then you will need to implement your own code in the node to translate the messages from the mcu into appropriate messages for ros topics, and subscribe to appropriate topics in ros and convert that data into appropriate messages for your mcu. These will need to be sent over serial, using something like pyserial

edit flag offensive delete link more

Comments

fsteinhardt gravatar image fsteinhardt  ( 2016-02-01 04:54:46 -0600 )edit

Thank you very much! @nickw

sonictl gravatar image sonictl  ( 2016-02-01 23:38:59 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-01-31 19:16:10 -0600

Seen: 1,038 times

Last updated: Feb 02 '16