Hey everyone,
I’m working from stable 1.8.2
I am making a custom vtol airframe and mixer and am attempting to write my control values to
_actuators_out_1->control[i] for roll, pitch, yaw, and thrust.
In my custom vtol_att_control class
void
Customvtol::fill_actuator_outputs(){
_actuators_out_1->timestamp = hrt_absolute_time();
_actuators_out_1->timestamp_sample = _actuators_mc_in->timestamp_sample;
// roll
_actuators_out_1->control[0] = _actuators_mc_in->control[0] * _mc_roll_weight;
// pitch
_actuators_out_1->control[1] = _actuators_mc_in->control[1] * _mc_pitch_weight;
// yaw
_actuators_out_1->control[2] = _actuators_mc_in->control[2] * _mc_yaw_weight;
// thrust
_actuators_out_1->control[3] = _thrust;
}
In my mixer I would like to then use that actuator group instead of group 0.
In my CustomMixer::mix(…) I then want to grab the control from group 1 instead of group 0. (assume this is a near exact copy of the mix_multirotor.cpp)
float roll = math::constrain(get_control(1, 0) * _roll_scale, -1.0f, 1.0f);
float pitch = math::constrain(get_control(1, 1) * _pitch_scale, -1.0f, 1.0f);
float yaw = math::constrain(get_control(1, 2) * _yaw_scale, -1.0f, 1.0f);
float thrust = math::constrain(get_control(1, 3), 0.0f, 1.0f);
But I just get 0s for these control values.
Everything works fine if I use _actuators_out_0->control[i] and get_control(0, i) instead.