UAVCAN

From STorM32-BGC Wiki
Jump to navigation Jump to search

The information on this page refers to firmware v2.30 and higher.

The STorM32 gimbal controller supports UAVCAN. This allows communicating with the STorM32 board via a CAN bus, very similar to the communication through the serial interfaces or Wifi.

Configuration

The Uavcan related parameters are split into the "normal" and the "Uavcan" parameter sections. The parameters in the normal section are accessible like any other parameter, e.g. via the GUI. The parameters in the Uavcan section are however accessible only by using Uavcan's mechanism for Node configuration. The two sections are exclusive, that is, a parameter is found in one or the other section, but not in both. The single exception is the Uavcan Node ID parameter, which can be configured by both mechanisms.

GUI Parameters

The parameters in the normal section are found in the [GUI:Interfaces Tool] window, which is accessible via the [GUI:Tools] menu.

Uavcan Configuration:
Set to “normal” to activate the Uavcan communication. The STorM32 board needs to be reset for a change to become effective.

Uavcan Node ID:
Sets the node ID of the STorM32 controller (default = 71).

Uavcan Parameters

The parameters in the Uavcan section can be accessed e.g. using the UAVCAN GUI Tool, and a SLCAN adapter. A uc4h SLCAN adapter provides probably the cheapest solution.

NodeId:
Sets the node ID of the STorM32 controller (default = 71).

NodeStatus Rate:
Sets the rate at which the uavcan.protocol.NodeStatus message is emitted (default = 1000).

GimbalStatus Rate:
Sets the rate at which the storm32.GimbalStatus message is emitted (default = 500).

Uavcan Messages

The STorM32 controller supports the Uavcan standard data types which are needed for basic operation, as well as some STorM32 specific data types.

Comment: It is not claimed that the STorM32 specific data types are the last conclusion of wisdom; they are open for discussion. They may however suggest a skeleton for standard definitions.

Standard Data Types

NodeStatus (BC 341)

See uavcan.protocol.NodeStatus.

GetNodeInfo (SR 1)

See uavcan.protocol.GetNodeInfo.

RestartNode (SR 5)

See uavcan.protocol.RestartNode.

Param.ExecuteOpCode (SR 10)

See uavcan.protocol.param.ExecuteOpcode.

Param.GetSet (SR 11)

See uavcan.protocol.param.GetSet.

STorM32 Data Types

GimbalStatus (BC 8300)

# Gimbal Attitude, angles in degrees +-180°, in gimbal frame.
float32 pitch_deg
float32 roll_deg
float32 yaw_deg

GimbalControl (BC 8301)

# Gimbal Attitude, angles in degrees +-180°, in gimbal frame.
float32 pitch
float32 roll
float32 yaw

GimbalNodeSpecific (BC 8302)

# Node Specific
uint8[<=64] payload

GimbalNodeSpecificAck (BC 8303)

# Node Specific Ack
uint8 initiator_node_id
uint8[<=64] payload