Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
63097bd8
Commit
63097bd8
authored
6 years ago
by
Daniel Agar
Browse files
Options
Downloads
Patches
Plain Diff
mavlink sort message defaults and float literal consistency
parent
1e14b10d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/mavlink/mavlink_main.cpp
+23
-23
23 additions, 23 deletions
src/modules/mavlink/mavlink_main.cpp
with
23 additions
and
23 deletions
src/modules/mavlink/mavlink_main.cpp
+
23
−
23
View file @
63097bd8
...
...
@@ -1610,7 +1610,7 @@ Mavlink::update_rate_mult()
float
mavlink_ulog_streaming_rate_inv
=
1.0
f
;
if
(
_mavlink_ulog
)
{
mavlink_ulog_streaming_rate_inv
=
1.
f
-
_mavlink_ulog
->
current_data_rate
();
mavlink_ulog_streaming_rate_inv
=
1.
0
f
-
_mavlink_ulog
->
current_data_rate
();
}
/* scale up and down as the link permits */
...
...
@@ -1692,7 +1692,7 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
}
};
const
float
unlimited_rate
=
-
1.
f
;
const
float
unlimited_rate
=
-
1.
0
f
;
switch
(
_mode
)
{
case
MAVLINK_MODE_NORMAL
:
...
...
@@ -1703,32 +1703,32 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local
(
"CAMERA_IMAGE_CAPTURED"
,
unlimited_rate
);
configure_stream_local
(
"COLLISION"
,
unlimited_rate
);
configure_stream_local
(
"DEBUG"
,
1.0
f
);
configure_stream_local
(
"DEBUG_VECT"
,
1.0
f
);
configure_stream_local
(
"DEBUG_FLOAT_ARRAY"
,
1.0
f
);
configure_stream_local
(
"DEBUG_VECT"
,
1.0
f
);
configure_stream_local
(
"DISTANCE_SENSOR"
,
0.5
f
);
configure_stream_local
(
"ESTIMATOR_STATUS"
,
0.5
f
);
configure_stream_local
(
"EXTENDED_SYS_STATE"
,
1.0
f
);
configure_stream_local
(
"GLOBAL_POSITION_INT"
,
5.0
f
);
configure_stream_local
(
"GPS_RAW_INT"
,
1.0
f
);
configure_stream_local
(
"GPS2_RAW"
,
1.0
f
);
configure_stream_local
(
"GPS_RAW_INT"
,
1.0
f
);
configure_stream_local
(
"HIGHRES_IMU"
,
1.5
f
);
configure_stream_local
(
"HOME_POSITION"
,
0.5
f
);
configure_stream_local
(
"LOCAL_POSITION_NED"
,
1.0
f
);
configure_stream_local
(
"NAMED_VALUE_FLOAT"
,
1.0
f
);
configure_stream_local
(
"NAV_CONTROLLER_OUTPUT"
,
1.5
f
);
configure_stream_local
(
"ODOMETRY"
,
3.0
f
);
configure_stream_local
(
"OPTICAL_FLOW_RAD"
,
1.0
f
);
configure_stream_local
(
"ORBIT_EXECUTION_STATUS"
,
5.0
f
);
configure_stream_local
(
"PING"
,
0.1
f
);
configure_stream_local
(
"POSITION_TARGET_LOCAL_NED"
,
1.5
f
);
configure_stream_local
(
"POSITION_TARGET_GLOBAL_INT"
,
1.5
f
);
configure_stream_local
(
"POSITION_TARGET_LOCAL_NED"
,
1.5
f
);
configure_stream_local
(
"RC_CHANNELS"
,
5.0
f
);
configure_stream_local
(
"SERVO_OUTPUT_RAW_0"
,
1.0
f
);
configure_stream_local
(
"SYS_STATUS"
,
1.0
f
);
configure_stream_local
(
"TRAJECTORY_REPRESENTATION_WAYPOINTS"
,
5.0
f
);
configure_stream_local
(
"UTM_GLOBAL_POSITION"
,
1.0
f
);
configure_stream_local
(
"VFR_HUD"
,
4.0
f
);
configure_stream_local
(
"ODOMETRY"
,
3.0
f
);
configure_stream_local
(
"WIND_COV"
,
1.0
f
);
configure_stream_local
(
"ORBIT_EXECUTION_STATUS"
,
5.
f
);
break
;
case
MAVLINK_MODE_ONBOARD
:
...
...
@@ -1743,20 +1743,22 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local
(
"CAMERA_TRIGGER"
,
unlimited_rate
);
configure_stream_local
(
"COLLISION"
,
unlimited_rate
);
configure_stream_local
(
"DEBUG"
,
10.0
f
);
configure_stream_local
(
"DEBUG_VECT"
,
10.0
f
);
configure_stream_local
(
"DEBUG_FLOAT_ARRAY"
,
10.0
f
);
configure_stream_local
(
"DEBUG_VECT"
,
10.0
f
);
configure_stream_local
(
"DISTANCE_SENSOR"
,
10.0
f
);
configure_stream_local
(
"ESTIMATOR_STATUS"
,
1.0
f
);
configure_stream_local
(
"EXTENDED_SYS_STATE"
,
5.0
f
);
configure_stream_local
(
"GLOBAL_POSITION_INT"
,
50.0
f
);
configure_stream_local
(
"GPS_RAW_INT"
,
unlimited_rate
);
configure_stream_local
(
"GPS2_RAW"
,
unlimited_rate
);
configure_stream_local
(
"GPS_RAW_INT"
,
unlimited_rate
);
configure_stream_local
(
"HIGHRES_IMU"
,
50.0
f
);
configure_stream_local
(
"HOME_POSITION"
,
0.5
f
);
configure_stream_local
(
"LOCAL_POSITION_NED"
,
30.0
f
);
configure_stream_local
(
"NAMED_VALUE_FLOAT"
,
10.0
f
);
configure_stream_local
(
"NAV_CONTROLLER_OUTPUT"
,
10.0
f
);
configure_stream_local
(
"ODOMETRY"
,
30.0
f
);
configure_stream_local
(
"OPTICAL_FLOW_RAD"
,
10.0
f
);
configure_stream_local
(
"ORBIT_EXECUTION_STATUS"
,
5.0
f
);
configure_stream_local
(
"PING"
,
1.0
f
);
configure_stream_local
(
"POSITION_TARGET_GLOBAL_INT"
,
10.0
f
);
configure_stream_local
(
"POSITION_TARGET_LOCAL_NED"
,
10.0
f
);
...
...
@@ -1769,9 +1771,7 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local
(
"TRAJECTORY_REPRESENTATION_WAYPOINTS"
,
5.0
f
);
configure_stream_local
(
"UTM_GLOBAL_POSITION"
,
1.0
f
);
configure_stream_local
(
"VFR_HUD"
,
10.0
f
);
configure_stream_local
(
"ODOMETRY"
,
30.0
f
);
configure_stream_local
(
"WIND_COV"
,
10.0
f
);
configure_stream_local
(
"ORBIT_EXECUTION_STATUS"
,
5.
f
);
break
;
case
MAVLINK_MODE_OSD
:
...
...
@@ -1804,27 +1804,29 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local
(
"ADSB_VEHICLE"
,
unlimited_rate
);
configure_stream_local
(
"ALTITUDE"
,
10.0
f
);
configure_stream_local
(
"ATTITUDE"
,
50.0
f
);
configure_stream_local
(
"ATTITUDE_TARGET"
,
8.0
f
);
configure_stream_local
(
"ATTITUDE_QUATERNION"
,
50.0
f
);
configure_stream_local
(
"
CAMERA_TRIG
GE
R
"
,
unlimited_rate
);
configure_stream_local
(
"
ATTITUDE_TAR
GE
T
"
,
8.0
f
);
configure_stream_local
(
"CAMERA_IMAGE_CAPTURED"
,
unlimited_rate
);
configure_stream_local
(
"CAMERA_TRIGGER"
,
unlimited_rate
);
configure_stream_local
(
"COLLISION"
,
unlimited_rate
);
configure_stream_local
(
"DEBUG"
,
50.0
f
);
configure_stream_local
(
"DEBUG_VECT"
,
50.0
f
);
configure_stream_local
(
"DEBUG_FLOAT_ARRAY"
,
50.0
f
);
configure_stream_local
(
"DEBUG_VECT"
,
50.0
f
);
configure_stream_local
(
"DISTANCE_SENSOR"
,
10.0
f
);
configure_stream_local
(
"GPS_RAW_INT"
,
unlimited_rate
);
configure_stream_local
(
"GPS2_RAW"
,
unlimited_rate
);
configure_stream_local
(
"ESTIMATOR_STATUS"
,
5.0
f
);
configure_stream_local
(
"EXTENDED_SYS_STATE"
,
2.0
f
);
configure_stream_local
(
"GLOBAL_POSITION_INT"
,
10.0
f
);
configure_stream_local
(
"GPS2_RAW"
,
unlimited_rate
);
configure_stream_local
(
"GPS_RAW_INT"
,
unlimited_rate
);
configure_stream_local
(
"HIGHRES_IMU"
,
50.0
f
);
configure_stream_local
(
"HOME_POSITION"
,
0.5
f
);
configure_stream_local
(
"LOCAL_POSITION_NED"
,
30.0
f
);
configure_stream_local
(
"MANUAL_CONTROL"
,
5.0
f
);
configure_stream_local
(
"NAMED_VALUE_FLOAT"
,
50.0
f
);
configure_stream_local
(
"NAV_CONTROLLER_OUTPUT"
,
10.0
f
);
configure_stream_local
(
"ODOMETRY"
,
30.0
f
);
configure_stream_local
(
"OPTICAL_FLOW_RAD"
,
10.0
f
);
configure_stream_local
(
"ORBIT_EXECUTION_STATUS"
,
5.0
f
);
configure_stream_local
(
"PING"
,
1.0
f
);
configure_stream_local
(
"POSITION_TARGET_GLOBAL_INT"
,
10.0
f
);
configure_stream_local
(
"RC_CHANNELS"
,
10.0
f
);
...
...
@@ -1835,9 +1837,7 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local
(
"TIMESYNC"
,
10.0
f
);
configure_stream_local
(
"UTM_GLOBAL_POSITION"
,
1.0
f
);
configure_stream_local
(
"VFR_HUD"
,
20.0
f
);
configure_stream_local
(
"ODOMETRY"
,
30.0
f
);
configure_stream_local
(
"WIND_COV"
,
10.0
f
);
configure_stream_local
(
"ORBIT_EXECUTION_STATUS"
,
5.
f
);
break
;
case
MAVLINK_MODE_IRIDIUM
:
...
...
@@ -1848,8 +1848,8 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
configure_stream_local
(
"ALTITUDE"
,
0.5
f
);
configure_stream_local
(
"ATTITUDE"
,
10.0
f
);
configure_stream_local
(
"EXTENDED_SYS_STATE"
,
0.1
f
);
configure_stream_local
(
"GPS_RAW_INT"
,
0.5
f
);
configure_stream_local
(
"GLOBAL_POSITION_INT"
,
5.0
f
);
configure_stream_local
(
"GPS_RAW_INT"
,
0.5
f
);
configure_stream_local
(
"HOME_POSITION"
,
0.1
f
);
configure_stream_local
(
"NAMED_VALUE_FLOAT"
,
1.0
f
);
configure_stream_local
(
"RC_CHANNELS"
,
0.5
f
);
...
...
@@ -1864,7 +1864,7 @@ Mavlink::configure_streams_to_default(const char *configure_single_stream)
if
(
configure_single_stream
&&
!
stream_configured
&&
strcmp
(
configure_single_stream
,
"HEARTBEAT"
)
!=
0
)
{
// stream was not found, assume it is disabled by default
return
configure_stream
(
configure_single_stream
,
0.
f
);
return
configure_stream
(
configure_single_stream
,
0.
0
f
);
}
return
ret
;
...
...
@@ -2948,8 +2948,8 @@ Mavlink::stream_command(int argc, char *argv[])
return
1
;
}
if
(
rate
<
0.
f
)
{
rate
=
-
2.
f
;
// use default rate
if
(
rate
<
0.
0
f
)
{
rate
=
-
2.
0
f
;
// use default rate
}
if
(
inst
!=
nullptr
)
{
...
...
@@ -3061,7 +3061,7 @@ $ mavlink stream -u 14556 -s HIGHRES_IMU -r 50
#endif
PRINT_MODULE_USAGE_PARAM_STRING
(
'd'
,
nullptr
,
"<file:dev>"
,
"Select Mavlink instance via Serial Device"
,
true
);
PRINT_MODULE_USAGE_PARAM_STRING
(
's'
,
nullptr
,
nullptr
,
"Mavlink stream to configure"
,
false
);
PRINT_MODULE_USAGE_PARAM_FLOAT
(
'r'
,
-
1.
f
,
0.
f
,
2000.
f
,
"Rate in Hz (0 = turn off, -1 = set to default)"
,
false
);
PRINT_MODULE_USAGE_PARAM_FLOAT
(
'r'
,
-
1.
0
f
,
0.
0
f
,
2000.
0
f
,
"Rate in Hz (0 = turn off, -1 = set to default)"
,
false
);
PRINT_MODULE_USAGE_COMMAND_DESCR
(
"boot_complete"
,
"Enable sending of messages. (Must be) called as last step in startup script."
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment