Skip to content

Preparing ROS for CAN operation

Guy Corbaz edited this page Sep 22, 2019 · 14 revisions

Introduction

NOTE: this post is not yet complete. What is described in it allows to do some simple tests between CAN and ROS.org ROS, but does now allow yet to pilot the wheels, and the robot. I will update this post as soon as I will have done more config.

Before using the KYDBL 2430-1E brushless controller with ROS, SocketCAN and CANOpen, we need to configure SocketCAN the ROS CANOpen stack. The steps are the following:

  1. Setup SocketCAN for automatic startup
  2. Create the network device
  3. The rest will come later 😇

Setup SocketCAN for automatic startup

In Installing SocketCAN we put together information we collected on the way to start SocketCAN. However, we had to re-type all the commands each time we wanted to start it. We now need to configure it to make sure the whole SocketCAN stack starts automatically.

Loading SocketCAN drivers

In order to automatically load SocketCAN drivers, you just have to create or modify the file /etc/modules as shown below.

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded # at boot time, one per line. Lines beginning with "#" are ignored.
can
can_raw
can_dev

When you reboot the system, you should now see the modules with lsmod. After having rebooted the system, you can chen if the modules have been correctly loaded with the command lsmod. You should see something like:

can_dev                28672  0
can_raw                20480  0
can                    24576  1 can_raw
Clone this wiki locally