apollo icon indicating copy to clipboard operation
apollo copied to clipboard

Analyzing CAN-messages

Open Trelsmo opened this issue 8 years ago • 9 comments

Hi,

When we try to view the can-messages the output from Apollo is just zeroes. Is there a way for Apollo to publish the can-messages so that they can be analyzed. We're running both bag-files and sim_control with can bus-module active when trying to view the messages.

Thanks in advance.

Trelsmo avatar Mar 08 '18 14:03 Trelsmo

Hi @Trelsmo , the sim_control one simulation does not have the control/canbus in the loop, so you would not see the can bus messages.

Capri2014 avatar Mar 15 '18 16:03 Capri2014

Which CAN 2 USB devices Apollo support:

  1. https://www.kvaser.com/product/kvaser-leaf-light-hs-v2/
  2. https://www.peak-system.com/PCAN-USB.199.0.html
  3. ...

?

ubercool2 avatar Mar 31 '18 01:03 ubercool2

@ubercool2 not exactly sure about your question, kvaser and PCAN are just two UBS-DB9 CAN analyzing tools. Technically you can see CAN messages via both

Capri2014 avatar Apr 04 '18 04:04 Capri2014

@Capri2014:

@ubercool2 not exactly sure about your question, kvaser and PCAN are just two UBS-DB9 CAN analyzing tools. Technically you can see CAN messages via both

This is absolutely wrong. The 2 products I linked above are CAN-2-USB converters and are used to receive and send CAN data via USB port. It seems to me that you are confusing them with the https://vector.com/vi_canalyzer_en.html.

Please have a look at this diagram if you are unsure what it takes to support one of the above devices: https://en.wikipedia.org/wiki/SocketCAN#/media/File:Socketcan.png.

  1. you need to enable the kernel support (e.g. https://github.com/JWhitleyAStuff/linuxcan-dkms)
  2. you need to install the right CAN lib: https://github.com/astuff/kvaser_interface
  3. you need to abstract the calls to CAN bus to e.g. ROS topics

This is what I meant by which CAN 2 USB device Apollo supports.

ubercool2 avatar Apr 04 '18 05:04 ubercool2

@ubercool2 Sorry for that, and thanks for pointing this out. In that case, then no, we do not have support for Kvaser nor PCAN.

Capri2014 avatar Apr 04 '18 06:04 Capri2014

@ubercool2 Let me know if you have further questions, otherwise I will close this one for now

Capri2014 avatar Apr 05 '18 20:04 Capri2014

@Capri2014 in hindsight it is actually better if you do not support CAN-2-USB since usb is a polling protocol and thus not real time.

The question still remains how do you then connect to CAN (over which physical device) and how do you convert your CAN messages to ROS messages (it is just too much code here in apollo for me to be able to understand everything immediately)?

ubercool2 avatar Apr 06 '18 15:04 ubercool2

@ubercool2 It is true that usbcan is no real time nor safe. But it actually provides a good way for people to visualize the can messages and way easier for people to debug OFFLINE.

For the actual in vehicle test, we use ESD with PCI connections, as config in default here: https://github.com/ApolloAuto/apollo/blob/master/modules/canbus/conf/canbus_conf.pb.txt

Capri2014 avatar Apr 07 '18 22:04 Capri2014

Closing this issue as there has been no communication in a while.

natashadsouza avatar Aug 27 '18 22:08 natashadsouza