UAVCAN: Difference between revisions

From STorM32-BGC Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
''The information on this page refers to firmware v2.30 and higher.''
''The information on this page refers to firmware v2.30 and higher.''


The STorM32 gimbal controller supports [http://uavcan.org/ UAVCAN]. This allows communicating with the STorM32 board via a [https://de.wikipedia.org/wiki/Controller_Area_Network CAN] bus, very similar to the communication through the [[Serial_Communication|serial interfaces]] or [[Using_a_ESP8266_Wifi_Module|Wifi]].
The STorM32 gimbal controller supports [http://uavcan.org/ UAVCAN]. This allows communicating with the STorM32 board through a [https://de.wikipedia.org/wiki/Controller_Area_Network CAN] bus, very similar to the communication through the [[Serial_Communication|serial interfaces]] or [[Using_a_ESP8266_Wifi_Module|Wifi]].


<div class="toclimit-2">__TOC__</div>
<div class="toclimit-2">__TOC__</div>
Line 7: Line 7:
== Configuration ==
== 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 [http://uavcan.org/Specification/6._Application_level_functions/#node-configuration 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 {{PARAMNAME|Uavcan Node ID}} parameter, which can be configured by both mechanisms.
The STorM32 parameters, which are related to Uavcan, are split into the "normal" and the "Uavcan" parameter sections. The parameters in the normal section are accessible like all the other parameters, e.g. via the GUI. The parameters in the Uavcan section are however accessible only by using Uavcan's [http://uavcan.org/Specification/6._Application_level_functions/#node-configuration Node configuration] mechanism. The two parameter sections are exclusive, that is, a parameter is either in the one or the other section, but not in both. The single exception is the {{PARAMNAME|Uavcan Node ID}} parameter, which can be configured by either mechanism.


=== GUI Parameters ===
=== GUI Parameters ===


The parameters in the normal section are found in the {{GUI|Interfaces Tool}} window, which is accessible via the {{GUI|Tools}} menu.
In the GUI, the parameters in the normal section are located in the {{GUI|Interfaces Tool}} window, which is accessible via the {{GUI|Tools}} menu.


{{PARAMNAME|Uavcan Configuration}}: <br> Set to {{PARAMVALUE|normal}} to activate the Uavcan communication. The STorM32 board needs to be reset for a change to become effective.
{{PARAMNAME|Uavcan Configuration}}: <br> Set to {{PARAMVALUE|normal}} to activate the Uavcan communication. The STorM32 board needs to be reset for a change to become effective.


{{PARAMNAME|Uavcan Node ID}}: <br> Sets the node ID of the STorM32 controller (default = 71).
{{PARAMNAME|Uavcan Node ID}}: <br> Sets the node ID of the STorM32 controller (default = 71). Dynamic node allocation is not supported. The range of allowed IDs is restricted to 11 - 124. The STorM32 board needs to be reset for a change to become effective.


=== Uavcan Parameters ===
=== Uavcan Parameters ===
Line 21: Line 21:
The parameters in the Uavcan section can be accessed e.g. using the [http://uavcan.org/GUI_Tool/Overview/ UAVCAN GUI Tool], and a SLCAN adapter. A [http://www.olliw.eu/2017/uavcan-for-hobbyists/ uc4h SLCAN adapter] provides probably the cheapest option.
The parameters in the Uavcan section can be accessed e.g. using the [http://uavcan.org/GUI_Tool/Overview/ UAVCAN GUI Tool], and a SLCAN adapter. A [http://www.olliw.eu/2017/uavcan-for-hobbyists/ uc4h SLCAN adapter] provides probably the cheapest option.


{{PARAMNAME|NodeId}}: <br> Sets the node ID of the STorM32 controller (default = 71).
{{PARAMNAME|NodeId}}: <br> Sets the node ID of the STorM32 controller (default = 71). Dynamic node allocation is not supported. The range of allowed IDs is restricted to 11 - 124. The STorM32 board needs to be reset for a change to become effective.


{{PARAMNAME|NodeStatus Rate}}: <br> Sets the rate at which the [http://uavcan.org/Specification/7._List_of_standard_data_types/#nodestatus uavcan.protocol.NodeStatus] message is emitted (default = 1000).  
{{PARAMNAME|NodeStatus Rate}}: <br> Sets the rate at which the [http://uavcan.org/Specification/7._List_of_standard_data_types/#nodestatus uavcan.protocol.NodeStatus] message is emitted (default = 1000). A value of 1000 means that a message is broadcasted every 1000 ms.


{{PARAMNAME|GimbalStatus Rate}}: <br> Sets the rate at which the storm32.GimbalStatus message is emitted (default = 500).
{{PARAMNAME|GimbalStatus Rate}}: <br> Sets the rate at which the storm32.GimbalStatus message is emitted (default = 500). A value of 500 means that a message is broadcasted every 500 ms. A value of 0 deactivates the emission of the message.


== Uavcan Messages ==
== Uavcan Messages ==
Line 35: Line 35:
=== Standard Data Types ===
=== Standard Data Types ===


==== NodeStatus (BC 341) ====
==== NodeStatus (BC, ID 341) ====


See [http://uavcan.org/Specification/7._List_of_standard_data_types/#nodestatus uavcan.protocol.NodeStatus].
See [http://uavcan.org/Specification/7._List_of_standard_data_types/#nodestatus uavcan.protocol.NodeStatus].


==== GetNodeInfo (SR 1) ====
==== GetNodeInfo (SR, ID 1) ====


See [http://uavcan.org/Specification/7._List_of_standard_data_types/#getnodeinfo uavcan.protocol.GetNodeInfo].
See [http://uavcan.org/Specification/7._List_of_standard_data_types/#getnodeinfo uavcan.protocol.GetNodeInfo].


==== RestartNode (SR 5) ====
==== RestartNode (SR, ID 5) ====


See [http://uavcan.org/Specification/7._List_of_standard_data_types/#restartnode uavcan.protocol.RestartNode].
See [http://uavcan.org/Specification/7._List_of_standard_data_types/#restartnode uavcan.protocol.RestartNode].


==== Param.ExecuteOpCode (SR 10) ====
==== Param.ExecuteOpCode (SR, ID 10) ====


See [http://uavcan.org/Specification/7._List_of_standard_data_types/#executeopcode uavcan.protocol.param.ExecuteOpcode].
See [http://uavcan.org/Specification/7._List_of_standard_data_types/#executeopcode uavcan.protocol.param.ExecuteOpcode].


==== Param.GetSet (SR 11) ====
==== Param.GetSet (SR, ID 11) ====


See [http://uavcan.org/Specification/7._List_of_standard_data_types/#getset uavcan.protocol.param.GetSet].
See [http://uavcan.org/Specification/7._List_of_standard_data_types/#getset uavcan.protocol.param.GetSet].
Line 57: Line 57:
=== STorM32 Data Types ===
=== STorM32 Data Types ===


==== GimbalStatus (BC 8300) ====
==== GimbalStatus (BC, ID 8300) ====


  # Gimbal Attitude, angles in degrees +-180°, in gimbal frame.
  # Gimbal Attitude, angles in degrees +-180°, in gimbal frame.
Line 64: Line 64:
  float32 yaw_deg
  float32 yaw_deg


==== GimbalControl (BC 8301) ====
Reports the camera angles in degrees. The yaw angle is relative to the gimbal frame or vehicle orientation.
 
==== GimbalControl (BC, ID 8301) ====


  # Gimbal Attitude, angles in degrees +-180°, in gimbal frame.
  # Gimbal Attitude, angles in degrees +-180°, in gimbal frame.
Line 71: Line 73:
  float32 yaw_deg
  float32 yaw_deg


==== GimbalNodeSpecific (BC 8302) ====
Moves the camera to the given orientation. The yaw angle is relative to the gimbal frame or vehicle orientation. It works like a CMD_SETANGLE command, see [[Inputs_and_Functions#Rc_Input_Processing|Inputs and Functions: Rc Input Processing]].
 
==== GimbalNodeSpecific (BC, ID 8302) ====


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


==== GimbalNodeSpecificAck (BC 8303) ====
The payload can correspond to any of the [[Serial_Communication#Serial_Communication_-_Simple_Commands|simple serial]] or [[Serial_Communication#Serial_Communication_-_RC_Commands|RC commands], with the crc word stripped off (the crc is not needed since the message is already protected by Uavcan]. Only commands of lengths less or equal 64 bytes can be handled (this excludes e.g. the 'p' command). The response of the STorM32 controller to the received command is packed into a GimbalNodeSpecificAck data type.
 
==== GimbalNodeSpecificAck (BC, ID 8303) ====


  # Node Specific Ack
  # Node Specific Ack
  uint8 initiator_node_id
  uint8 initiator_node_id
  uint8[<=64] payload
  uint8[<=64] payload
The payload holds the response byte stream to any of the [[Serial_Communication#Serial_Communication_-_Simple_Commands|simple serial]] or [[Serial_Communication#Serial_Communication_-_RC_Commands|RC commands], with the crc word stripped off. Only responses of lengths less or equal 64 bytes can be handled (this excludes e.g. the 'g' command). The initiator_node_id holds the id of the node, which emitted the GimbalNodeSpecific message to which this is the response to.

Revision as of 09:34, 30 July 2017

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 through a CAN bus, very similar to the communication through the serial interfaces or Wifi.

Configuration

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

GUI Parameters

In the GUI, the parameters in the normal section are located 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). Dynamic node allocation is not supported. The range of allowed IDs is restricted to 11 - 124. The STorM32 board needs to be reset for a change to become effective.

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 option.

NodeId:
Sets the node ID of the STorM32 controller (default = 71). Dynamic node allocation is not supported. The range of allowed IDs is restricted to 11 - 124. The STorM32 board needs to be reset for a change to become effective.

NodeStatus Rate:
Sets the rate at which the uavcan.protocol.NodeStatus message is emitted (default = 1000). A value of 1000 means that a message is broadcasted every 1000 ms.

GimbalStatus Rate:
Sets the rate at which the storm32.GimbalStatus message is emitted (default = 500). A value of 500 means that a message is broadcasted every 500 ms. A value of 0 deactivates the emission of the message.

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, ID 341)

See uavcan.protocol.NodeStatus.

GetNodeInfo (SR, ID 1)

See uavcan.protocol.GetNodeInfo.

RestartNode (SR, ID 5)

See uavcan.protocol.RestartNode.

Param.ExecuteOpCode (SR, ID 10)

See uavcan.protocol.param.ExecuteOpcode.

Param.GetSet (SR, ID 11)

See uavcan.protocol.param.GetSet.

STorM32 Data Types

GimbalStatus (BC, ID 8300)

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

Reports the camera angles in degrees. The yaw angle is relative to the gimbal frame or vehicle orientation.

GimbalControl (BC, ID 8301)

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

Moves the camera to the given orientation. The yaw angle is relative to the gimbal frame or vehicle orientation. It works like a CMD_SETANGLE command, see Inputs and Functions: Rc Input Processing.

GimbalNodeSpecific (BC, ID 8302)

# Node Specific
uint8[<=64] payload

The payload can correspond to any of the simple serial or [[Serial_Communication#Serial_Communication_-_RC_Commands|RC commands], with the crc word stripped off (the crc is not needed since the message is already protected by Uavcan]. Only commands of lengths less or equal 64 bytes can be handled (this excludes e.g. the 'p' command). The response of the STorM32 controller to the received command is packed into a GimbalNodeSpecificAck data type.

GimbalNodeSpecificAck (BC, ID 8303)

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

The payload holds the response byte stream to any of the simple serial or [[Serial_Communication#Serial_Communication_-_RC_Commands|RC commands], with the crc word stripped off. Only responses of lengths less or equal 64 bytes can be handled (this excludes e.g. the 'g' command). The initiator_node_id holds the id of the node, which emitted the GimbalNodeSpecific message to which this is the response to.