Documentation Status

Cannot load information on name: socketcan_interface, distro: electric, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.
Cannot load information on name: socketcan_interface, distro: fuerte, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.
Cannot load information on name: socketcan_interface, distro: groovy, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.
Cannot load information on name: socketcan_interface, distro: hydro, which means that it is not yet in our index. Please see this page for information on how to submit your repository to our index.
ros_canopen: can_msgs | canopen_402 | canopen_chain_node | canopen_master | canopen_motor_node | socketcan_bridge | socketcan_interface

Package Summary

Released Continuous integration Documented

This package contains a generic CAN interface description with helpers for filtering and driver implementation. Further a socketcan implementation based on boost::asio is included.

ros_canopen: can_msgs | canopen_402 | canopen_chain_node | canopen_master | canopen_motor_node | socketcan_bridge | socketcan_interface

Package Summary

Released Continuous integration Documented

This package contains a generic CAN interface description with helpers for filtering and driver implementation. Further a socketcan implementation based on boost::asio is included.

ros_canopen: can_msgs | canopen_402 | canopen_chain_node | canopen_master | canopen_motor_node | socketcan_bridge | socketcan_interface

Package Summary

Released Continuous integration Documented

This package contains a generic CAN interface description with helpers for filtering and driver implementation. Further a socketcan implementation based on boost::asio is included.

ros_canopen: can_msgs | canopen_402 | canopen_chain_node | canopen_master | canopen_motor_node | socketcan_bridge | socketcan_interface

Package Summary

Released Continuous integration Documented

This package contains a generic CAN interface description with helpers for filtering and driver implementation. Further a socketcan implementation based on boost::asio is included.

Overview

This packages provides a generic CAN interface class and a SocketCAN-based driver implementation.

The interface is divided into three parts:

  • StateInterface: Listener interface for the state of the driver

  • CommInterface: Listener interface for receiving messages and send functionality

  • DriverInterface: inherits from both and adds management interfaces

The listeners are based on FastDelegate and use RAII-pointers.

The SocketCAN driver interface is based on Boost.Asio and provides concurrent access to SocketCAN interfaces. It is the default CAN implementation used throughout ros_canopen and requires Linux kerner 2.6.25 or newer.

Plug-in system

The SocketCAN driver is exposed as "can::SocketCANInterface" with base class can::DriverInterface via class_loader. In addition the plugin library is announced to pluginlib.

Tested Drivers and Devices

The SocketCAN driver interface should work with all SocketCAN network interfaces. The linux mainline kernel already includes some device drivers, other devices are supported by vendor-provided implementations.

The following devices were tested with socketcan_interface:

Vendor

Device

Driver

Status

Comments

PEAK-System Technik GmbH

PEAK-USB

Kernel peak_usb

Works

PEAK-cPCI

Kernel peak_pci

Not working

IRQ problems

Vendor (NETDEV!)

Works

esd electronic system design gmbh

CAN-USB/2

Kernel esd_usb2

Works

Preparation

Load driver

Set-up udev rules or type manually:

sudo modprobe peak_usb # kernel driver, since 3.11 

sudo modprobe peak_pci # kernel driver

sudo modprobe pcan # PEAK vendor driver

sudo modprobe esd_usb2 # kernel driver

Initialize NIC

Bring-up CAN NIC (Linux kernel drivers):

sudo ip link set can0 up type can bitrate 500000 # adjust bitrate as needed

Further options are availabe, please consult SocketCAN Readme, section 6.5. For automatic set-up, the network can be configured in /etc/network/interfaces, e.g.:

allow-hotplug can0
iface can0 can static
    bitrate 500000
#    up ip link set $IFACE txqueuelen 20 # uncomment if more than 4 nodes are used

Tools and Debugging

socketcan_dump

Simple test program provided with the package, just prints the recrived messages:

rosrun socketcan_interface socketcan_dump can0

ip -details -statistics link show can0

(not available for all drivers)

can-utils

Feature-rich tool suite for SocketCAN, install with:

sudo apt-get install can-utils
  • candump
  • cansend
  • canbusload

Wiki: socketcan_interface (last edited 2017-01-18 15:29:13 by MathiasLuedtke)