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

Revision history [back]

click to hide/show revision 1
initial version

Expanding from dornhege, I would first write some Python/C++ code that communicates with the microcontroller. You could use the CAN drivers that are included with Linux, which are called Socket-CAN. There should be plenty of example code using that, on the internet. Once you can send/receive CAN messages, you then need to design the commands for a software driver for your car, eg. turnLeft() driveForward() which take a control command and send a CAN message.

Once you have your driver for the car working, you can incorporate it into ROS. You should read all the tutorials and write some publisher and subscriber nodes. Then you need to implement your higher level commands as a ROS subscriber, eg. if a tele-operation node publishes a Float64 message on the /drive_forward_command topic, the subscriber inside your rc_car_driver node gets a callback and processes the contents of the ROS message, sending the velocity value to the driveForward() function.

This post is useful: http://answers.ros.org/question/11691/how-to-communicate-the-hardware-to-a-realtime-controller/

It could be a lot of work to implement this when your microcontroller and the embedded PC are sitting next to each other. www.ros.org/wiki/rosserial

Expanding from dornhege, I would first write some Python/C++ code that communicates with the microcontroller. You could use the CAN drivers that are included with Linux, which are called Socket-CAN. There should be plenty of example code using that, on the internet. Once you can send/receive CAN messages, you then need to design the commands for a software driver for your car, eg. turnLeft() driveForward() which take a control command and send a CAN message.

Once you have your driver for the car working, you can incorporate it into ROS. You should read all the tutorials and write some publisher and subscriber nodes. Then you need to implement your higher level commands as a ROS subscriber, eg. if a tele-operation node publishes a Float64 message on the /drive_forward_command topic, the subscriber inside your rc_car_driver node gets a callback and processes the contents of the ROS message, sending the velocity value to the driveForward() function.

This post is useful: http://answers.ros.org/question/11691/how-to-communicate-the-hardware-to-a-realtime-controller/

It could be a lot of work to implement this when your microcontroller and the embedded PC are sitting next to each other. www.ros.org/wiki/rosserial

Another possibility is: http://www.ros.org/wiki/rosserial

Expanding from dornhege, I would first write some Python/C++ code that communicates with the microcontroller. You could use the CAN drivers that are included with Linux, which are called Socket-CAN. There should be plenty of example code using that, on the internet. Once you can send/receive CAN messages, you then need to design the commands for a software driver for your car, eg. turnLeft() driveForward() which take a control command and send a CAN message.

Once you have your driver for the car working, you can incorporate it into ROS. You should read all the tutorials and write some publisher and subscriber nodes. Then you need to implement your higher level commands as a ROS subscriber, eg. if a tele-operation node publishes a Float64 message on the /drive_forward_command topic, the subscriber inside your rc_car_driver node gets a callback and processes the contents of the ROS message, sending the velocity value to the driveForward() function.

This post is useful: http://answers.ros.org/question/11691/how-to-communicate-the-hardware-to-a-realtime-controller/

It could be a lot of work to implement this when your microcontroller and the embedded PC are sitting next to each other. Another possibility is: http://www.ros.org/wiki/rosserial

http://www.ros.org/wiki/rosserial It sounds like it's pretty easy to send rosserial messages directly to an arduino: http://answers.ros.org/question/12464/splitting-work-between-ros-and-a-custom-motor-controller-board/