mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-11 20:43:34 +08:00
Added standard DSDL types: uavcan.*, uavcan.protocol.*, uavcan.mavlink.*
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
#
|
||||
# Represents the quality of associated data, higher is better.
|
||||
#
|
||||
|
||||
float16 UNKNOWN = -65504
|
||||
float16 MIN = 0
|
||||
float16 MAX = 65504
|
||||
float16 value
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Global timestamp in hectomicroseconds (1 = 100 usec), 6 bytes.
|
||||
#
|
||||
|
||||
uint48 UNKNOWN = 0
|
||||
uint48 USEC_PER_LSB = 100 # Timestamp resolution
|
||||
truncated uint48 husec # Hectomicroseconds (10^-4)
|
||||
@@ -0,0 +1,10 @@
|
||||
#
|
||||
# Encapsulated MAVLink message.
|
||||
#
|
||||
|
||||
uint8 seq
|
||||
uint8 sysid
|
||||
uint8 compid
|
||||
uint8 msgid
|
||||
|
||||
uint8[<256] payload
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Time synchronization; publish frequency 0.5 Hz.
|
||||
# Should be UTC time, not GPS time nor local time.
|
||||
# Any node that publishes a timestamped data must use this time reference.
|
||||
# Multiple nodes can provide the time synchronization concurrently.
|
||||
#
|
||||
|
||||
uint16 PUBLICATION_PERIOD_MS = 2000
|
||||
|
||||
uavcan.Timestamp timestamp # Must be known
|
||||
float16 timestamp_variance # Units of the timestamp ^2
|
||||
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# This message must never be published during normal operation. This message may
|
||||
# be published with high frequency (~10..100 Hz) to inform the network participants
|
||||
# that the system has entered unrecoverable fault condition (e.g. mission critical
|
||||
# node failure) and is not capable of further operation.
|
||||
#
|
||||
# Typical reaction to this message may include emergency motor/power shutdown,
|
||||
# safety parachute deployment, etc. Nodes that are expected to react to this message
|
||||
# should wait for at least MIN_MESSAGES subsequent messages published with the
|
||||
# interval no higher than MAX_INTERVAL_MS before undertaking any emergency actions.
|
||||
#
|
||||
|
||||
uint8 MIN_MESSAGES = 5
|
||||
uint16 MAX_INTERVAL_MS = 500
|
||||
|
||||
# Short description that would fit into single CAN frame
|
||||
uint8[<=8] reason_text
|
||||
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# Abstract node status information.
|
||||
# Must be published periodically.
|
||||
#
|
||||
|
||||
uint16 PUBLICATION_PERIOD_MS = 1000
|
||||
|
||||
# If a node fails to publish this message in this amount of time, it should be considered offline.
|
||||
uint16 OFFLINE_TIMEOUT_MS = 4000
|
||||
|
||||
# Uptime counter should never overflow.
|
||||
uint24 uptime_sec
|
||||
|
||||
# Status code should be used to reflect the node status in the most abstract way.
|
||||
# Use cases: top-level onboard computer should not allow the UAV to begin normal operation
|
||||
# unless all nodes report OK. If a mission critical node reports CRITICAL status, current
|
||||
# mission should be immediately yet safely aborted (e.g. RTL).
|
||||
# OFFLINE status can be actually reported by the node to explicitly inform other network
|
||||
# participants that the sending node is about to shutdown. In this case other nodes will not
|
||||
# have to wait OFFLINE_TIMEOUT_MS before they detect that the node is no longer available.
|
||||
uint4 STATUS_OK = 0
|
||||
uint4 STATUS_INITIALIZING = 1
|
||||
uint4 STATUS_WARNING = 2
|
||||
uint4 STATUS_CRITICAL = 3
|
||||
uint4 STATUS_OFFLINE = 15
|
||||
uint4 status_code
|
||||
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Full node info request.
|
||||
#
|
||||
|
||||
---
|
||||
|
||||
Version software_version
|
||||
Version hardware_version
|
||||
Version uavcan_version
|
||||
|
||||
NodeStatus status
|
||||
|
||||
# Human readable name, e.g. "pixhawk", "gnss_mag". Alphanumeric and underscores.
|
||||
uint8[<64] name
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# This message can be broadcasted in order to perform global network discovery.
|
||||
# Alternatively, it is possible to wait some time so each node of the network
|
||||
# transmits NodeStatus message at least once.
|
||||
#
|
||||
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# Get the implementation details of a given data type.
|
||||
#
|
||||
|
||||
uint16 id
|
||||
DataTypeKind kind
|
||||
|
||||
---
|
||||
|
||||
DataTypeSignature signature # Data type hash as computed by DSDL compiler (type name + each field)
|
||||
DataTypeName name # Full data type name, e.g. "std.node.GetDataTypeInfo"
|
||||
|
||||
uint8 MASK_KNOWN = 1 # This data type is defined
|
||||
uint8 MASK_SUBSCRIBED = 2 # Subscribed to messages of this type
|
||||
uint8 MASK_PUBLISHING = 4 # Publishing messages of this type
|
||||
uint8 MASK_SERVING = 8 # Providing service of this type
|
||||
uint8 mask
|
||||
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Get protocol statistics for CAN and UAVCAN.
|
||||
#
|
||||
|
||||
---
|
||||
|
||||
# CAN bus statistics, for each interface independently
|
||||
uint64[<=3] can_frames_tx
|
||||
uint64[<=3] can_frames_rx
|
||||
uint64[<=3] can_frames_errors
|
||||
|
||||
# UAVCAN transport layer statistics
|
||||
uint64 transfers_tx
|
||||
uint64 transfers_rx
|
||||
uint32 transfers_rx_errors
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# This service allows to detect type compatibility between two nodes in one request.
|
||||
#
|
||||
|
||||
DataTypeIDMask known_ids
|
||||
DataTypeKind kind
|
||||
|
||||
---
|
||||
|
||||
DataTypeIDMask mutually_known_ids
|
||||
DataTypeSignature aggregate_signature
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Restart the node.
|
||||
# Some nodes may require restart before the new configuration will be applied.
|
||||
#
|
||||
|
||||
uint64 MAGIC_NUMBER = 0xACCE551B1E012345
|
||||
uint64 magic_number
|
||||
|
||||
---
|
||||
|
||||
bool ok
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Data type ID mask; 1 - known, 0 - unknown.
|
||||
#
|
||||
|
||||
bool[1024] value
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Data type kind (message or service).
|
||||
#
|
||||
|
||||
uint2 SERVICE = 0
|
||||
uint2 MESSAGE = 1
|
||||
uint2 value
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Full data type name.
|
||||
#
|
||||
|
||||
uint8[<=80] value
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# Data type signature value, 64 bit.
|
||||
#
|
||||
|
||||
uint64 value
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Nested type.
|
||||
# Generic version information.
|
||||
#
|
||||
|
||||
uint8 major
|
||||
uint8 minor
|
||||
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Generic named parameter (key/value pair).
|
||||
#
|
||||
|
||||
uint3 TYPE_UNDEF = 0
|
||||
uint3 TYPE_INTEGER = 1
|
||||
uint3 TYPE_FLOAT = 2
|
||||
uint3 TYPE_STRING = 3
|
||||
uint3 TYPE_BYTES = 4
|
||||
uint3 type
|
||||
|
||||
uint8[<64] key
|
||||
|
||||
float64[<=1] numeric_value # For type = INTEGER, FLOAT
|
||||
uint8[<256] binary_value # For type = STRING, BYTES
|
||||
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# Start HIL simulation for the specified components.
|
||||
#
|
||||
|
||||
uint64 MAGIC_NUMBER = 0xACCE551B1E012345
|
||||
uint64 magic_number
|
||||
|
||||
uint64 component_mask # Components are application defined
|
||||
|
||||
---
|
||||
|
||||
bool ok
|
||||
@@ -0,0 +1,12 @@
|
||||
#
|
||||
# Generic log message.
|
||||
#
|
||||
|
||||
uint3 SEVERITY_DEBUG = 0
|
||||
uint3 SEVERITY_INFO = 1
|
||||
uint3 SEVERITY_WARNING = 2
|
||||
uint3 SEVERITY_ERROR = 3
|
||||
uint3 severity
|
||||
|
||||
uint8[<32] source
|
||||
uint8[<128] text
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Remote file info.
|
||||
#
|
||||
|
||||
Path path
|
||||
|
||||
---
|
||||
|
||||
Crc crc
|
||||
int64 size
|
||||
Errno result
|
||||
@@ -0,0 +1,17 @@
|
||||
#
|
||||
# Remote directory contents.
|
||||
#
|
||||
|
||||
uint32 entry_index
|
||||
Path directory_path
|
||||
|
||||
---
|
||||
|
||||
Errno result
|
||||
|
||||
uint4 ENTRY_TYPE_NONE = 0
|
||||
uint4 ENTRY_TYPE_FILE = 1
|
||||
uint4 ENTRY_TYPE_DIR = 2
|
||||
uint4 entry_type
|
||||
|
||||
Path entry_abs_path
|
||||
@@ -0,0 +1,9 @@
|
||||
#
|
||||
# Remote file deletion request.
|
||||
#
|
||||
|
||||
Path path
|
||||
|
||||
---
|
||||
|
||||
Errno result
|
||||
@@ -0,0 +1,15 @@
|
||||
#
|
||||
# Read contents of the file from a remote node.
|
||||
# Use cases: Firmware update, log download.
|
||||
#
|
||||
|
||||
int64 offset
|
||||
Path path
|
||||
|
||||
---
|
||||
|
||||
Errno result
|
||||
|
||||
# Empty data means the offset is out of file boundaries.
|
||||
# Non-empty data means the end of file is not reached yet, even if the length is less than max.
|
||||
truncated uint8[<256] data
|
||||
@@ -0,0 +1,11 @@
|
||||
#
|
||||
# Initiates file transfer between two nodes.
|
||||
# Use cases: Configuration file replacement, executable update.
|
||||
#
|
||||
|
||||
Path src # On the requesting node
|
||||
Path dst # On the serving node
|
||||
|
||||
---
|
||||
|
||||
Errno result
|
||||
@@ -0,0 +1,16 @@
|
||||
#
|
||||
# This service initiates the firmware update procedure.
|
||||
#
|
||||
# Nodes are allowed to explicitly reject this request under some circumstances
|
||||
# (e.g. ESC should reject this if the motor is running).
|
||||
#
|
||||
# If the node accepts the request, initiator will get the response immediately,
|
||||
# before the update process actually begins.
|
||||
#
|
||||
|
||||
Path image_file_remote_path
|
||||
|
||||
---
|
||||
|
||||
Errno result
|
||||
uint8[<64] error_message
|
||||
@@ -0,0 +1,6 @@
|
||||
#
|
||||
# File CRC.
|
||||
# Algorithm: CRC-64-WE.
|
||||
#
|
||||
|
||||
uint64 value
|
||||
@@ -0,0 +1,5 @@
|
||||
#
|
||||
# File operation result - UNIX errno.
|
||||
#
|
||||
|
||||
int16 value
|
||||
@@ -0,0 +1,7 @@
|
||||
#
|
||||
# Encoded FS path (ASCII/UTF8).
|
||||
#
|
||||
|
||||
uint8 SEPARATOR = 47 # ASCII '/'
|
||||
|
||||
uint8[<128] value
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
256..399 - high priority equipment
|
||||
|
||||
500..519 - nav
|
||||
|
||||
550..599 - protocol
|
||||
|
||||
600..749 - low priority eqipment
|
||||
|
||||
767 - MAVLink
|
||||
@@ -52,8 +52,10 @@ if (GTEST_FOUND)
|
||||
|
||||
# DSDL compiler invocation
|
||||
add_custom_target(dsdlc dsdl_compiler/dsdlc.py -v
|
||||
test/dsdl_test/root_ns_a test/dsdl_test/root_ns_b # Inputs
|
||||
-Otest/dsdlc_output # Output
|
||||
test/dsdl_test/root_ns_a # Input
|
||||
test/dsdl_test/root_ns_b # Input
|
||||
${CMAKE_SOURCE_DIR}/../dsdl/uavcan # Input
|
||||
-Otest/dsdlc_output # Output
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
|
||||
add_dependencies(libuavcan_test dsdlc)
|
||||
include_directories(${CMAKE_SOURCE_DIR}/test/dsdlc_output)
|
||||
|
||||
Reference in New Issue
Block a user