KITmedical / kacanopen

Easy-to-use CanOpen stack and CanOpen-to-ROS bridge.
Other
94 stars 57 forks source link

Problem Connecting to OpenCanNetwork #8

Closed OliEfr closed 6 years ago

OliEfr commented 6 years ago

Hi, i want to communicate between ROS and CanOpen with kacanopen pkg.

I am using the pcan adapter. To run socketcan_bridge i did not install the pcan_driver. socketcan_bridge connects perfectly fine to the network and i can send and receive msgs. I did catkin_make -DDRIVER=socket to build kacanopen.

What else should i prepare to detect devices with kacanopen pkg?

I do:

  1. start socketcan_bridge: "Successfully connected to can0"
  2. change busname in kacanopen to can0
  3. rosrun kacanopen listdevices. It start fine but i get as output: "List devices ... num_devices =0" although a device is connected to the can network.

I trief to build with peak_linux instead, but it was not successfull: cannot find -lcan_peak_linux (i installed the pcan driver)

maetulj commented 6 years ago

@OliEfr Is the baudrate correct?

I use the Peak CAN-USB converter. To use it I needed to install the Peak drivers. Then I need to load the driver to the kernel with "sudo modprobe peak_usb" and then also set the interface up with "sudo ip link set can0 up type can bitrate 500000" (example for 500 kB). Based on your comment I would guess either the baudrate of the interface or kacanopen is wrong.

OliEfr commented 6 years ago

doing "sudo modprobe peak_usb" worked for me. Thank you.