Advice on implementing variable pitch propeller in gazebo for px4_sitl

Hi

I’m working on drone which uses an additional variable pitch propeller on the back, controlled via some ROS topic.

This propeller allows forwards and backwards movement without altering the drones pitch.

I am attempting to create my drone in the px4_sitl, but am unsure on the best way to create this variable pitch propeller.

The propeller spins at a constant RPM, with the pitch being changed allowing a variable velocity.

My current approach is to create a new propeller that is similar to the typical quadrotor propellers, using the libgazebo_motor_model.so plugin.

I am extending the plugin to allow the ROS topic to vary the motorConstant parameter and turningDirection, allowing forwards and backwards movement.

I have reduced the timeConstants, this I think will work but it’s not ideal- is there a better way to implement a ‘real’ variable pitch, rather than essentially just switching the motor in and out of reverse quickly?

Thanks for any input

Just in case anyone comes across this in the future, I implemented my variable pitch propeller by
creating a new plugin, a modified version of motor_model plugin to subscribe to a ROS topic obtaining a pitch value between -1 and 1.

Where the force is calculated in motor_model.cpp (force * scalar) I then multiplied by my pitch value, this works as I’d hoped.

@Uplinkc60 Would be awesome if you could contribute your changes to https://github.com/PX4/sitl_gazebo