Commit 57a54ab7 authored by Roman Bapst's avatar Roman Bapst
Browse files

mavlink interface: support for standard vtol plane

parent 88a90e2b
......@@ -83,7 +83,7 @@ void GazeboMavlinkInterface::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf
hil_sensor_pub_ = node_handle_->Advertise<mavlink::msgs::HilSensor>(hil_sensor_mavlink_pub_topic_, 1);
hil_gps_pub_ = node_handle_->Advertise<mavlink::msgs::HilGps>(hil_gps_mavlink_pub_topic_, 1);
_rotor_count = 4;
_rotor_count = 5;
last_time_ = world_->GetSimTime();
last_gps_time_ = world_->GetSimTime();
double gps_update_interval_ = 200*1000000; // nanoseconds for 5Hz
......@@ -396,6 +396,9 @@ void GazeboMavlinkInterface::handle_message(mavlink_message_t *msg)
input_reference_[i] = inputs.control[i] * scaling + offset;
}
// pusher/puller throttle for the standard vtol plane
input_reference_[4] = (inputs.control[6] + 1.0f) / 2 * 1800 + (inputs.control[6] > -1 ? 500 : 0);
if (right_elevon_joint_ != NULL && left_elevon_joint_!= 0 && elevator_joint_ != 0) {
// set angles of control surface joints (this should go into a message for the correct plugin)
double roll = 0.5 * (inputs.control[4] + inputs.control[5]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment