Ask Your Question
0

Can't set default values for FCU parameters via Mavros.

asked 2021-01-28 08:02:18 -0500

damians gravatar image

updated 2021-01-28 09:59:43 -0500

Hi,

I'm using PX4 drone in Gazebo, Mavros to control and QGroundControl to monitor drone - source

I'm using Mavros topic "~param/set" which uses this type of message ParamSet to change FCU parameters values. Everything from console via rosservice. For instance I tried to change Geofencing values. After setting this parameters for certain values I can't change them back to default values using the same commend. I check parameters in QGroundControl.

Example:

rosservice call /mavros/param/set "param_id: 'GF_MAX_HOR_DIST' value: integer: 0 real: 100.0"

Changes GF_MAX_HOR_DIST to 100 m , but after using

rosservice call /mavros/param/set "param_id: 'GF_MAX_HOR_DIST' value: integer: 0 real: 0.0"

nothing changes. This is important because value 0 is default and disables Geofencing.

I know I can reset this parameters in QGC, but I want to do via mavros.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-03-26 13:11:42 -0500

I managed to set the parameter to 100 using this:

rosservice call /mavros/param/set "GF_MAX_HOR_DIST" [0,100.0]

and then back to 0 with:

rosservice call /mavros/param/set "GF_MAX_HOR_DIST" [0,0.0]

However, I've found the easiest way to programmatically set parameters over mavros is using rospy. An example how to use rosservices with rospy and mavros is here.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2021-01-28 08:02:18 -0500

Seen: 60 times

Last updated: Jan 28