serial drivers/modules: add yaml config files

This commit is contained in:
Beat Küng
2018-09-25 07:53:29 +02:00
parent dae292631c
commit b5e552924a
21 changed files with 212 additions and 32 deletions
+2
View File
@@ -59,6 +59,8 @@ px4_add_module(
mavlink_stream.cpp
mavlink_ulog.cpp
mavlink_timesync.cpp
MODULE_CONFIG
module.yaml
DEPENDS
airspeed
git_mavlink_v2
+5
View File
@@ -682,6 +682,11 @@ int Mavlink::mavlink_open_uart(int baud, const char *uart_name, bool force_flow_
case 1500000: speed = B1500000; break;
#endif
#ifdef B2000000
case 2000000: speed = B2000000; break;
#endif
#ifdef B3000000
case 3000000: speed = B3000000; break;
+78
View File
@@ -0,0 +1,78 @@
__max_num_config_instances: &max_num_config_instances 3
module_name: MAVLink
serial_config:
- command: |
set MAV_ARGS "-b p:${BAUD_PARAM} -m p:MAV_${i}_MODE -r p:MAV_${i}_RATE"
if param compare MAV_${i}_FORWARD 1
then
set MAV_ARGS "${MAV_ARGS} -f"
fi
mavlink start -d ${SERIAL_DEV} ${MAV_ARGS} -x
port_config_param:
name: MAV_${i}_CONFIG
group: MAVLink
# MAVLink instances:
# 0: Telem1 Port (Telemetry Link)
# 1: Telem2 Port (Companion Link). Disabled by default to reduce RAM usage
# 2: Board-specific / no fixed function or port
default: [TEL1, "", ""]
num_instances: *max_num_config_instances
parameters:
- group: MAVLink
definitions:
MAV_${i}_MODE:
description:
short: MAVLink Mode for instance ${i}
long: |
The MAVLink Mode defines the set of streamed messages (for example the
vehicle's attitude) and their sending rates.
type: enum
values:
0: Normal
1: Custom
2: Onboard
3: OSD
4: Magic
5: Config
6: Iridium
7: Minimal
reboot_required: true
num_instances: *max_num_config_instances
default: [0, 2, 0]
MAV_${i}_RATE:
description:
short: Maximum MAVLink sending rate for instance ${i}
long: |
Configure the maximum sending rate for the MAVLink streams in Bytes/sec.
If the configured streams exceed the maximum rate, the sending rate of
each stream is automatically decreased.
If this is set to 0, a value of <baudrate>/20 is used, which corresponds to
half of the theoretical maximum bandwidth.
type: int32
min: 0
unit: B/s
reboot_required: true
num_instances: *max_num_config_instances
default: [1200, 0, 0]
MAV_${i}_FORWARD:
description:
short: Enable MAVLink Message forwarding for instance ${i}
long: |
If enabled, forward incoming MAVLink messages to other MAVLink ports if the
message is either broadcast or the target is not the autopilot.
This allows for example a GCS to talk to a camera that is connected to the
autopilot via MAVLink (on a different link than the GCS).
type: boolean
reboot_required: true
num_instances: *max_num_config_instances
default: [true, false, false]
@@ -106,6 +106,8 @@ if (NOT "${config_rtps_send_topics}" STREQUAL "" OR NOT "${config_rtps_receive_t
microRTPS_client_main.cpp
${msg_out_path}/micrortps_client/microRTPS_client.cpp
${msg_out_path}/micrortps_client/microRTPS_transport.cpp
MODULE_CONFIG
module.yaml
DEPENDS
topic_bridge_files
)
@@ -0,0 +1,17 @@
module_name: RTPS
serial_config:
- command: |
protocol_splitter start ${SERIAL_DEV}
mavlink start -d /dev/mavlink -b p:${BAUD_PARAM} -m onboard -r 5000 -x
micrortps_client start -d /dev/rtps -b p:${BAUD_PARAM} -l -1
port_config_param:
name: RTPS_MAV_CONFIG
group: RTPS
label: MAVLink + FastRTPS
- command: |
micrortps_client start -d ${SERIAL_DEV} -b p:${BAUD_PARAM} -l -1
port_config_param:
name: RTPS_CONFIG
group: RTPS
label: FastRTPS