Ask Your Question
0

Does a CAN bus library or package exist in ROS?

asked 2014-01-27 14:54:27 -0600

updated 2014-01-28 17:19:10 -0600

ngrennan gravatar image

Newbie here. I have installed ROS Hydro and I have run through all the ROS basic tutorials but I have no practical experience yet. I have an ELMO motor controller and motor set up on a workbench with a CAN bus interface. I'm ready to try to write some code to send commands over the CAN bus to turn the motor on and off, but I don't really know where to start.

Are there any CAN bus libraries included with ROS or something that I can download as a plugin? Any other advise for a newbie? Thanks in advance!

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
2

answered 2014-01-27 20:51:35 -0600

gvdhoorn gravatar image

AFAIK there is no really 'generic CAN driver node' available, but some packages that interface to CAN do exist. For instance the cob_generic_can package:

The package cob_generic_can provides an interface for nodes on a can-bus and examplary wrappers for two PeakSys-can-libs. When a can-bus-device is generated (for an example see cob_base_drive_chain) you can use generic_can to create as many itfs as there will be components communicating via this can-bus. Assign type of the can communication device (e.g. usb-to-can or can-card of a specific vendor) and can-address of the target device. This package comes with wrappers for PeakSys and PeakSysUSB adapters.

I'm not sure you can directly use this for your specific setup, but it should provide you with enough pointers to get something going.

edit flag offensive delete link more

Comments

Thanks! I'll check it out!

Kurt Leucht gravatar imageKurt Leucht ( 2014-02-01 03:18:08 -0600 )edit

Just curious if you got this working i am looking at using it to control some maxon EPOS controllers and was wondering if you had some pointers?

Ryan Steindl gravatar imageRyan Steindl ( 2014-04-07 13:26:44 -0600 )edit

I have not had the opportunity yet. My machine has the can-utils installed: https://gitorious.org/linux-can/can-utils/source/67a2bdcd336e6becfa5784742e18c88dbeddc973: So I borrowed some of that code and tweaked it and wrote a node that sends CAN commands based on the cansend.c file that works fine.

Kurt Leucht gravatar imageKurt Leucht ( 2014-04-09 03:39:14 -0600 )edit
0

answered 2014-05-05 02:58:12 -0600

This is probably a terrible answer, but my machine had the can-utils installed: https://gitorious.org/linux-can/can-u... ... so I borrowed some of that code and tweaked it and wrote a node that sends CAN commands based on the can-utils cansend.c file that works just fine for my purposes. I just needed a proof of concept so this was a quick and dirty way to prove I could send CAN messages from a ROS node. This won't be my final production code, though. I will look into the cob_generic_can package to see what benefits it gives me.

edit flag offensive delete link more

Comments

@Kurt Leucht, Is it really works that you use CAN bus node of ROS to send command to the your motor?

Terry Su gravatar imageTerry Su ( 2016-01-02 01:34:25 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2014-01-27 14:54:27 -0600

Seen: 6,245 times

Last updated: May 05 '14