mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 15:03:34 +08:00
ROS: Fixes for ROS build
The ROS build included some files that used isfinite vs PX4_ISFINITE. The AppState class also needed to be supported for ROS. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -236,10 +236,10 @@ void MulticopterAttitudeControl::handle_vehicle_attitude(const px4_vehicle_atti
|
||||
control_attitude_rates(dt);
|
||||
|
||||
/* publish actuator controls */
|
||||
_actuators.data().control[0] = (isfinite(_att_control(0))) ? _att_control(0) : 0.0f;
|
||||
_actuators.data().control[1] = (isfinite(_att_control(1))) ? _att_control(1) : 0.0f;
|
||||
_actuators.data().control[2] = (isfinite(_att_control(2))) ? _att_control(2) : 0.0f;
|
||||
_actuators.data().control[3] = (isfinite(_thrust_sp)) ? _thrust_sp : 0.0f;
|
||||
_actuators.data().control[0] = (PX4_ISFINITE(_att_control(0))) ? _att_control(0) : 0.0f;
|
||||
_actuators.data().control[1] = (PX4_ISFINITE(_att_control(1))) ? _att_control(1) : 0.0f;
|
||||
_actuators.data().control[2] = (PX4_ISFINITE(_att_control(2))) ? _att_control(2) : 0.0f;
|
||||
_actuators.data().control[3] = (PX4_ISFINITE(_thrust_sp)) ? _thrust_sp : 0.0f;
|
||||
_actuators.data().timestamp = px4::get_time_micros();
|
||||
|
||||
if (!_actuators_0_circuit_breaker_enabled) {
|
||||
|
||||
@@ -537,7 +537,7 @@ MulticopterPositionControl::control_auto(float dt)
|
||||
_pos_sp = pos_sp_s.edivide(scale);
|
||||
|
||||
/* update yaw setpoint if needed */
|
||||
if (isfinite(_pos_sp_triplet->data().current.yaw)) {
|
||||
if (PX4_ISFINITE(_pos_sp_triplet->data().current.yaw)) {
|
||||
_att_sp_msg.data().yaw_body = _pos_sp_triplet->data().current.yaw;
|
||||
}
|
||||
|
||||
@@ -554,9 +554,9 @@ void MulticopterPositionControl::handle_parameter_update(const px4_parameter_upd
|
||||
void MulticopterPositionControl::handle_position_setpoint_triplet(const px4_position_setpoint_triplet &msg)
|
||||
{
|
||||
/* Make sure that the position setpoint is valid */
|
||||
if (!isfinite(_pos_sp_triplet->data().current.lat) ||
|
||||
!isfinite(_pos_sp_triplet->data().current.lon) ||
|
||||
!isfinite(_pos_sp_triplet->data().current.alt)) {
|
||||
if (!PX4_ISFINITE(_pos_sp_triplet->data().current.lat) ||
|
||||
!PX4_ISFINITE(_pos_sp_triplet->data().current.lon) ||
|
||||
!PX4_ISFINITE(_pos_sp_triplet->data().current.alt)) {
|
||||
_pos_sp_triplet->data().current.valid = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user