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

Views: 205

Reply to This

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service