0
$\begingroup$

Rosanswers logo

Hi, our team want to develop an autonomous car on the basis of a RC-Car. As framework we want to use ROS. Unfortunately none of us has any experiences with ROS.

The microcontroller that interfaces with the hardware of the car shall communicate with an embedded PC via CAN. The embedded PC has a CAN interface. I have found the can_communication stack, which contains a package called can_msgs. If I have understood right this package provides only a CAN library for ROS and is not executable. Is there something like a ready CAN-node? Unless how can I realize a CAN communication? Currently I'm the only person which works on the software. Unfortunately I have not many experiences in this field. Hence I would be very grateful for any help.


Originally posted by platzhirsch on ROS Answers with karma: 21 on 2012-10-19

Post score: 1


Original comments

Comment by thebyohazard on 2012-10-19:
I've never used it, but I know care-o-bot uses CAN and has the cob_generic_can package.

$\endgroup$

2 Answers 2

0
$\begingroup$

Rosanswers logo

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 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/


Originally posted by dbworth with karma: 1103 on 2012-10-20

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$
0
$\begingroup$

Rosanswers logo

Usually, this is part of the driver itself (at least for our implementations) and the ROS abstraction layer is higher, e.g., things like odometry or velocity commands.


Originally posted by dornhege with karma: 31395 on 2012-10-19

This answer was NOT ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.