parameters: new parameter server backend

- parameter backend is now running in a wq and accessible over pub/sub
 - parameters library can call into backend directly (with locking), but operations will gradually start moving to pub/sub
 - majority of parameters migrated as is, only small changes to parameter autosave and parameter notification that are now performed from the WQ thread
This commit is contained in:
Daniel Agar
2022-12-20 09:51:48 -05:00
parent 278bce7446
commit 5247db7647
41 changed files with 2975 additions and 2431 deletions
+10 -2
View File
@@ -182,8 +182,8 @@ set(msg_files
TrajectoryWaypoint.msg
TransponderReport.msg
TuneControl.msg
UavcanParameterRequest.msg
UavcanParameterValue.msg
ParameterRequest.msg
ParameterValue.msg
UlogStream.msg
UlogStreamAck.msg
UwbDistance.msg
@@ -219,6 +219,14 @@ set(msg_files
WheelEncoders.msg
Wind.msg
YawEstimatorStatus.msg
Parameter.msg
SrvParameterGetRequest.msg
SrvParameterGetResponse.msg
SrvParameterSetRequest.msg
SrvParameterSetResponse.msg
)
list(SORT msg_files)
+12
View File
@@ -0,0 +1,12 @@
char[17] name # parameter name
int16 index # -1 if the param_id field should be used as identifier
int16 index_used # -1 if the param_id field should be used as identifier
uint8 TYPE_INVALID = 0
uint8 TYPE_BOOL = 1
uint8 TYPE_INT32 = 2
uint8 TYPE_FLOAT32 = 3
uint8 type # parameter type
int32 int32_value # current value if param_type is int-like
float32 float32_value # current value if param_type is float-like
+27
View File
@@ -0,0 +1,27 @@
# parameter request type
uint64 timestamp # time since system start (microseconds)
uint8 MESSAGE_TYPE_INVALID = 0
uint8 MESSAGE_TYPE_PARAM_REQUEST_READ = 1
uint8 MESSAGE_TYPE_PARAM_REQUEST_LIST = 2
uint8 MESSAGE_TYPE_PARAM_SET = 3
uint8 message_type # message type
uint8 NODE_ID_ALL = 0 # MAV_COMP_ID_ALL
uint8 node_id # node ID
char[17] name # parameter name
int16 param_index # -1 if the param_id field should be used as identifier
uint8 TYPE_INVALID = 0
uint8 TYPE_BOOL = 1
uint8 TYPE_INT32 = 2
uint8 TYPE_FLOAT32 = 3
uint8 type # parameter type
int32 int32_value # current value if param_type is int-like
float32 float32_value # current value if param_type is float-like
uint8 ORB_QUEUE_LENGTH = 8
# TOPICS parameter_request uavcan_parameter_request
+2 -7
View File
@@ -4,11 +4,6 @@ uint64 timestamp # time since system start (microseconds)
uint32 instance # Instance count - constantly incrementing
uint32 get_count
uint32 set_count
uint32 find_count
uint32 export_count
uint16 count
uint16 active
uint16 changed
uint16 custom_default
Parameter changed_param
+22
View File
@@ -0,0 +1,22 @@
# parameter response type
uint64 timestamp # time since system start (microseconds)
uint8 node_id # requester node ID
char[17] param_name # parameter name
int16 param_index # parameter index, if known
uint16 param_count # number of parameters exposed by the node
uint8 type # parameter type
int32 int32_value # current value if param_type is int-like
float32 float32_value # current value if param_type is float-like
uint64 timestamp_requested
uint8 ORB_QUEUE_LENGTH = 8
# TOPICS parameter_value uavcan_parameter_value
+6
View File
@@ -0,0 +1,6 @@
uint64 timestamp # time since system start (microseconds)
char[17] name # parameter name
int16 index # -1 if the param_id field should be used as identifier
uint8 ORB_QUEUE_LENGTH = 16
+11
View File
@@ -0,0 +1,11 @@
uint64 timestamp # time since system start (microseconds)
uint64 timestamp_requested
Parameter parameter
uint8 RESULT_GET_SUCCESS = 0
uint8 RESULT_GET_FAILED = 1
uint8 RESULT_ERROR_INVALID_PARAMETER = 2
uint8 result
uint8 ORB_QUEUE_LENGTH = 16
+5
View File
@@ -0,0 +1,5 @@
uint64 timestamp # time since system start (microseconds)
Parameter parameter
uint8 ORB_QUEUE_LENGTH = 8
+11
View File
@@ -0,0 +1,11 @@
uint64 timestamp # time since system start (microseconds)
uint64 timestamp_requested
Parameter parameter
uint8 RESULT_SET_SUCCESS = 0
uint8 RESULT_SET_FAILED = 1
uint8 RESULT_ERROR_INVALID_PARAMETER = 2
uint8 result
uint8 ORB_QUEUE_LENGTH = 8
-23
View File
@@ -1,23 +0,0 @@
# UAVCAN-MAVLink parameter bridge request type
uint64 timestamp # time since system start (microseconds)
uint8 MESSAGE_TYPE_PARAM_REQUEST_READ = 20 # MAVLINK_MSG_ID_PARAM_REQUEST_READ
uint8 MESSAGE_TYPE_PARAM_REQUEST_LIST = 21 # MAVLINK_MSG_ID_PARAM_REQUEST_LIST
uint8 MESSAGE_TYPE_PARAM_SET = 23 # MAVLINK_MSG_ID_PARAM_SET
uint8 message_type # MAVLink message type: PARAM_REQUEST_READ, PARAM_REQUEST_LIST, PARAM_SET
uint8 NODE_ID_ALL = 0 # MAV_COMP_ID_ALL
uint8 node_id # UAVCAN node ID mapped from MAVLink component ID
char[17] param_id # MAVLink/UAVCAN parameter name
int16 param_index # -1 if the param_id field should be used as identifier
uint8 PARAM_TYPE_UINT8 = 1 # MAV_PARAM_TYPE_UINT8
uint8 PARAM_TYPE_INT64 = 8 # MAV_PARAM_TYPE_INT64
uint8 PARAM_TYPE_REAL32 = 9 # MAV_PARAM_TYPE_REAL32
uint8 param_type # MAVLink parameter type
int64 int_value # current value if param_type is int-like
float32 real_value # current value if param_type is float-like
uint8 ORB_QUEUE_LENGTH = 4
-9
View File
@@ -1,9 +0,0 @@
# UAVCAN-MAVLink parameter bridge response type
uint64 timestamp # time since system start (microseconds)
uint8 node_id # UAVCAN node ID mapped from MAVLink component ID
char[17] param_id # MAVLink/UAVCAN parameter name
int16 param_index # parameter index, if known
uint16 param_count # number of parameters exposed by the node
uint8 param_type # MAVLink parameter type
int64 int_value # current value if param_type is int-like
float32 real_value # current value if param_type is float-like