Hi, I’m using PX4 1.13.0, and I want to check some value in controlallocator, here is what I’ve modified:
const matrix::Vector<float, NUM_ACTUATORS> &getActuatorTrim() const { return _actuator_trim; }
const matrix::Vector<float, NUM_AXES> &getControlTrim() const { return _control_trim; }
if (_actuator_effectiveness != nullptr) {
PX4_INFO("Effectiveness Source: %s", _actuator_effectiveness->name());
}
// Print current effectiveness matrix
for (int i = 0; i < _num_control_allocation; ++i) {
const ActuatorEffectiveness::EffectivenessMatrix &effectiveness = _control_allocation[i]->getEffectivenessMatrix();
if (_num_control_allocation > 1) {
PX4_INFO("Instance: %i", i);
}
PX4_INFO(" custom print test.");
PX4_INFO(" Effectiveness.T =");
effectiveness.T().print();
PX4_INFO(" minimum =");
_control_allocation[i]->getActuatorMin().T().print();
PX4_INFO(" maximum =");
_control_allocation[i]->getActuatorMax().T().print();
PX4_INFO(" actuator_trim =");
_control_allocation[i]->getActuatorTrim().T().print();
PX4_INFO(" control_trim =");
_control_allocation[i]->getControlTrim().T().print();
PX4_INFO(" Configured actuators: %i", _control_allocation[i]->numConfiguredActuators());
}
first, I use make clean
command;
second, I use make px4_sitl gazebo
command.
finally, revise the mavros_posix_sitl.launch:
<arg name="vehicle" default="iris_ctrlalloc"/>
and run roslaunch px4 mavros_posix_sitl.launch
then in the px4 terminal, run commander takeoff
and control_allocator status
, but I got:
even without the string print?
thanks a lot for any advice!