Mav_cmd_do_set_servo


#1

Hi,

I need to drop a payload after landing (or while flying) using MAVLINK. I have a PX4 vtol plane with flytpi.
Have investigated the px4 doc a lot, but can not understand hoe to send a DO_SET_SERVO cmd to control AUX outputs on the pixhawk.
Can you help me, I know this is PX4 related, but can not get any help from their forum at the moment.

I can send the set servo cmd , but do not know what servo id to add to the command, and how that is connected to what AUX output. Also what is needed to be setup in PX4 in pixhawk to enable the aux output to work.
Using a switch via transmitter we can get to work, but not via mavlink command
(have it working with ardupilot, but px4 seems more complicated and less documented for me so far)

is is an EPM magnetic gripper device so need to set a certain pwm for about a second and then return to 1500 again as neutral.

best regards,
Sebastian


#2

Hi @SebastianW,

My earlier understanding was, you were using APM. Why have you switched to PX4? Any particular reason?

I might be wrong but IIUC, you have to send DO_SET_SERVO command inside a waypoint mission. Px4 does not support sending this command via mavros/cmd/command API.

This is the definition of its params:
// params[0] actuator number to be set 0…5 (corresponds to AUX outputs 1…6)
// params[1] new value for selected actuator in ms 900…2000

How did you configure Px4 to get this working?


#3

Hi!
Thanks for answering this question.

Yes we are using APm for our X8 multitoror, but we have bought a VTOL plane, which is pre-equipped and tuned with a PX4 from factory. So we can not change that for now.
Yes I send the DO_SET_SERVO command in a waypoint mission, but I do not know what servo id corresponds to what AUX output so can not get it to work. And what setups is needed in PX4 to make it work.
Also tested to send command 183 (do_set_Servo) via /mavros/cmd/command but maybe that is not working at all as you say? I used this method for APM tests sucessfully. I can not find any good doc that explains the PX4 behaviour around this.

I also get it to work via a RC switch (RC pass through to aux), but unfortunaly that is not solving what I need.
We have a pending question about this to one of teh PX4 developers, so lets see if we get some reply to get this to work. I will update this question with any info I get about this topic.

Thanks,
Sebastian


#4

Hi,

Is this information not solving your problem?


#5

Hi,
Sorry missed that part, I will test it next time I am flying.
I will also try to check if i can run a misison on the ground with takeoff commands.

Will let you know the progess.

Thanks,
Sebastian