Howdy,

I am looking to use two motors mounted on both ends of a seesaw stand to do a simple PD test and ensure that my code for stabilizing my pixhawk in pitch is working properly. I currently have the code working, but it is controlling servos and not motors. I was wondering how I would go about controlling motors?

Would I have to change this structure here, from 0 to 3 for the correct motor control group?

struct actuator_controls_s actuators;memset(&actuators, 0, sizeof(actuators));orb_advert_t actuator_pub_ptr = orb_advertise(ORB_ID(actuator_controls_0), &actuators);

This current is the structure I use to control my servos

struct actuator_controls_s actuators;memset(&actuators, 0, sizeof(actuators));orb_advert_t actuator_pub_ptr = orb_advertise(ORB_ID(actuator_controls_3), &actuators);

Would this allow me to control the motors if I am sending value from 0 to 1?
Or could I just use the same structure that I am using for the servos, but control the motors by sending values from -1 to 1?

Also what exactly changes when I choose a different control, group? is there something fundamentally different or is it just a format to more easily understand the code?

Thank you for the help!

Best Regards,

Israel Casillas

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…