Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions rosplane/src/controller/controller_ros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ void ControllerROS::actuator_controls_publish()
actuators.mode = rosflight_msgs::msg::Command::MODE_PASS_THROUGH;

// Package control efforts. If the output is infinite replace with 0.
actuators.qx = (std::isfinite(output.delta_a)) ? output.delta_a : 0.0f;
actuators.qy = (std::isfinite(output.delta_e)) ? output.delta_e : 0.0f;
actuators.qz = (std::isfinite(output.delta_r)) ? output.delta_r : 0.0f;
actuators.fx = (std::isfinite(output.delta_t)) ? output.delta_t : 0.0f;
actuators.u[3] = (std::isfinite(output.delta_a)) ? output.delta_a : 0.0f;
actuators.u[4] = (std::isfinite(output.delta_e)) ? output.delta_e : 0.0f;
actuators.u[5] = (std::isfinite(output.delta_r)) ? output.delta_r : 0.0f;
actuators.u[0] = (std::isfinite(output.delta_t)) ? output.delta_t : 0.0f;

// Publish actuators.
actuators_pub_->publish(actuators);
Expand Down
8 changes: 4 additions & 4 deletions rosplane_extra/src/input_mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,16 +249,16 @@ void InputMapper::command_callback(const rosflight_msgs::msg::Command::SharedPtr
{
u_int8_t ignore = rosflight_msgs::msg::Command::IGNORE_NONE;
if (params_.get_string("aileron_input") == "rc_aileron") {
ignore |= rosflight_msgs::msg::Command::IGNORE_QX;
ignore |= rosflight_msgs::msg::Command::IGNORE_VALUE3;
}
if (params_.get_string("elevator_input") == "rc_elevator") {
ignore |= rosflight_msgs::msg::Command::IGNORE_QY;
ignore |= rosflight_msgs::msg::Command::IGNORE_VALUE4;
}
if (params_.get_string("rudder_input") == "rc_rudder") {
ignore |= rosflight_msgs::msg::Command::IGNORE_QZ;
ignore |= rosflight_msgs::msg::Command::IGNORE_VALUE5;
}
if (params_.get_string("throttle_input") == "rc_throttle") {
ignore |= rosflight_msgs::msg::Command::IGNORE_FX;
ignore |= rosflight_msgs::msg::Command::IGNORE_VALUE0;
}
msg->ignore = ignore;
mapped_command_pub_->publish(*msg);
Expand Down
Loading