Skip to content

Software

socketcan_adapter

By Polymath Robotics, from github.com/polymathrobotics/socketcan_adapter (opens in a new tab)

  • Middleware
  • Driver or SDK
  • Apache-2.0

A C++ SocketCAN driver library with a ROS2 wrapper, for connecting Linux systems to CAN buses in robotics applications.

Facts

GitHub stars
12read on 29 Nov 2026
Last update
24 Nov 2026Newest commit on main
Maintenance
Activea commit in the last 90 days
Difficulty
Intermediate
Hardware it needs, as the project states it
Linux with SocketCAN support, a C++17 compiler and CMake 3.8+; the ROS2 package needs ROS2 Humble or later and can_msgs. Hardware tests need a CAN interface, and a virtual CAN device can be used for testing without hardware.

Checked on GitHub on 29 Nov 2026.

Licenses

Code
Apache-2.0 (opens in a new tab)

Read by Robotheca from LICENSE (opens in a new tab) (Apache-2.0) at commit 573986b (opens in a new tab), on 29 Nov 2026.

Commercial use
Yes

At a glance

What it is
  • Provides a standalone C++ SocketCAN library that has no ROS dependencies and can be used in non-ROS projects.
  • Offers thread-safe operations with callback-based asynchronous message processing.
  • Supplies configurable filters and error handling.
  • Includes a ROS2 lifecycle node and launch files with parameter support, integrated with can_msgs.
  • Includes a companion library for bridging Axiomatic CAN-ETH adapters, which can also route Ethernet traffic onto SocketCAN.

Robotheca's summary of the project's documents, not the creator's words.

Robots on Robotheca
No robot on Robotheca uses it yet.
Licence
Apache-2.0. Commercial use: Yes. Where it was read
Install
In the creator's words: The project's README (opens in a new tab)
Maintenance
Active, last commit on 24 Nov 2026.

Use it

How to install it, in the creator's words: The project's README (opens in a new tab)

Robotheca doesn't review code. Read it before running it.

Files and versions

Facts read at commit 573986b

Robotheca read the repository at two versions: the summary at 3a963a8 and the facts and the README at 573986b (read on 29 Nov 2026).

Robotheca never hosts the code: each link goes to the creator's own page.

The README

The creator's own README, copied as written: README.md by Polymath Robotics, at commit 573986b, under Apache-2.0 (opens in a new tab). The original on GitHub (opens in a new tab).

Read the README here

SocketCAN Adapter

A modular SocketCAN driver library and ROS2 integration for Linux-based systems. This repository provides both a standalone C++ library and ROS2 wrapper for easy integration with robotics applications.

Architecture

This package is split into two complementary components:

socketcan_adapter (opens in a new tab)

Pure C++ SocketCAN library with no ROS dependencies.

  • Core SocketCAN functionality
  • Thread-safe operations
  • Callback-based asynchronous processing
  • Configurable filters and error handling
  • Can be used in non-ROS projects
socketcan_adapter_ros (opens in a new tab)

ROS2 wrapper providing nodes and launch files.

  • ROS2 lifecycle node
  • Integration with can_msgs
  • Launch files with parameter support
  • Depends on the core socketcan_adapter library
axiomatic_adapter (opens in a new tab)

C++ library to connect CAN data to Axiomatic CAN-ETH adapter

  • Core Axiomatic ETH-CAN bridge functionality
  • Modeled after the socketcan_adapter
  • Has an additional bridge to leverage the socketcan_adapter library to put eth traffic on socketcan
Quick Start
Build Both Packages
# Install dependencies
rosdep install -i -y --from-paths .

# Build everything
colcon build --packages-up-to socketcan_adapter_ros
Launch ROS2 CAN Bridge
ros2 launch socketcan_adapter_ros socketcan_bridge_launch.py
Use Core Library in C++
#include "socketcan_adapter/socketcan_adapter.hpp"

using namespace polymath::socketcan;

SocketcanAdapter adapter("can0");
adapter.openSocket();
// ... see socketcan_adapter README for full example
Requirements
System Requirements
  • Linux with SocketCAN support
  • C++17 compatible compiler
  • CMake 3.8+
ROS2 Requirements (for ROS package only)
  • ROS2 Humble or later
  • can_msgs package
Testing
Core Library Tests
colcon test --packages-select socketcan_adapter
Hardware Tests

Set CAN_AVAILABLE=1 to enable hardware-dependent tests:

CAN_AVAILABLE=1 colcon test --packages-select socketcan_adapter
Virtual CAN Setup

For testing without hardware:

sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
License

Licensed under the Apache License, Version 2.0. See LICENSE (opens in a new tab) for the full license text.

Authors & Maintainers

Robotheca lists software as a reference: nothing is hosted or run here, and every fact links to where it was read.