Directly set PWM output values with uORB?

I’m trying to output each PWM channel from publishing to uORB topic to accomplish a certain control scheme, but by publishing to actuator_controls topic it quickly gets overwritten with 0 by another publisher. Is it possible to disable whatever is overwriting the topic, or is there another way to control each channel individually?

If you’re working on a quad and you are looking at main outputs, it should be the attitude controller that writes on actuator controls.

Please notice that these outputs are then processed by the mixer and send to actuators outputs topic before being transformed into PWM signals, so you can always disable your mixer and bypass its output by publishing on this topic for really ambitious changes on the control structure.

Thank you for your reply. How would I disable the mixer? I noticed there is a mixer file that directly passthrough each control group, but I could not figure out where to select mixers.

Also, is there a way to see where the uORB topics are updated from?

Hey @j919828, have you found any solution for this problem?

How should I send commands to the attitude controller? The code given here(scroll to the bottom) doesn’t seem to work.

If you want to control the PWM output individually, you need to set the function for the pins in the airframe that you’re using you want, for example servo control 1 in the channel 1 pin of the IO processor:

param set-default PWM_MAIN_FUNC1 201

Then publish the values you want in servo controls topic.

uint16_t command = 1800; // whatever value but you have to convert it to fit into the [-1,1] range

_actuator_servos.control[0] = (1.0/700) * (command - 1400) ;
_actuator_servos.timestamp = hrt_absolute_time();