Skip to content

RaccoonlabDev/cyphal_application

Repository files navigation

Code Smells Lines of Code build

Cyphal application template

A minimal application always includes the following features:

Type Message Comment Rate
1 pub uavcan.node.Heartbeat Abstract node status info 1 Hz
2 pub uavcan.node.port.List Node network capabilities 0.2 Hz
3 RPC-service uavcan.node.GetInfo Full node info
4 RPC-service uavcan.node.ExecuteCommand Restart, save or reset registers
5 RPC-service uavcan.register.List
uavcan.register.Access
Register interface

There are also examples of the following auxilliary features:

Interface Port Message
udral/actuator sub.setpoint
sub.readiness
pub.feedback
udral.service.actuator.common.sp.Vector31
reg.udral.service.common.Readiness
zubax.telega.CompactFeedback
Barometer pub.pressure
pub.temperature
uavcan.si.sample.pressure.Scalar
uavcan.si.sample.temperature.Scalar
Magnetometer pub.mag uavcan.si.sample.magnetic_field_strength.Vector3
udral/gnss pub.point
pub.status
pub.sats
pub.pdop
reg.udral.physics.kinematics.geodetic.PointStateVarTs
uavcan.primitive.scalar.Integer16
uavcan.primitive.scalar.Integer16
uavcan.primitive.scalar.Integer16
imu pub.accelerometer
pub.gyro
uavcan.si.sample.acceleration.Vector3
uavcan.si.sample.angular_velocity.Vector3

Supported platforms:

CAN_PLATFORM Implementation details Note
bxcan platform_specific_components Tested on stm32f103 only
fdcan STM32 HAL Tested on stm32g0 only
socketcan platform_specific_components Tested on ubuntu 22.04

1. Prerequisites

The library depends on a few other repositories.

Already inlcuded in the repository:

External dependency:

2. Usage:

Step 1. Clone repo with dependency

git clone https://github.com/RaccoonlabDev/cyphal_application.git
cd cyphal_application
git clone --branch v0.7.0 https://github.com/PonomarevDA/libparams.git Libs/libparams

Step 2. Include CMakeList.txt

In your application's cmake file specify the target, include this CMakeLists.txt and add source code to the executable:

# 1. select either bxcan or fdcan or socketcan
set(CAN_PLATFORM bxcan)

# 2. include CMakeLists.txt
include(<path_to_this_repo>/Cyphal/CMakeLists.txt)

# 3. add ${CYPHAL_SRC} to our source files
add_executable(<executable_name> ${CYPHAL_SRC})

Step 3. (Optionally) Provide an additional info

It is nice to fill GetInfo with an information specific to your application:

Software version Defined on the compile time with APP_VERSION_MAJOR and APP_VERSION_MINOR defines.
Hardware version Should be defined on the initialization time.
Certificate of authenticity Not supported by this example yet.
Unique ID It is expected to provide HAL_GetUIDw0, HAL_GetUIDw1 and HAL_GetUIDw2. By default, it is provided by STM32 HAL.
Software VCS Revision ID Defined on the compile time with GIT_HASH define.

3. Usage examples:

Platform Example
stm32f103 Mini v2 example
Ubuntu Minimal application example
Ubuntu Publisher example
Ubuntu PX4/ArduPilot HITL communicator (Cyphal <-> ROS converter)