parametrize imu input for ros dummy att estimator

This commit is contained in:
Thomas Gubler 2015-02-02 23:02:42 +01:00
parent 515266c163
commit 18cc20b04b
3 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,7 @@
<param name="MPC_XY_VEL_I" type="double" value="0.0" />
<param name="MPC_XY_VEL_D" type="double" value="0.01" />
<param name="MPC_XY_VEL_MAX" type="double" value="2.0" />
<param name="vehicle_model" type="string" value="ardrone" />
</group>
</launch>

View File

@ -1,6 +1,7 @@
<launch>
<include file="$(find mav_gazebo)/launch/ardrone_empty_world_with_joy.launch" />
<!-- <include file="$(find mav_gazebo)/launch/ardrone_empty_world.launch" /> -->
<include file="$(find px4)/launch/ardrone.launch" />
</launch>

View File

@ -48,9 +48,11 @@
AttitudeEstimator::AttitudeEstimator() :
_n(),
// _sub_modelstates(_n.subscribe("/gazebo/model_states", 1, &AttitudeEstimator::ModelStatesCallback, this)),
_sub_imu(_n.subscribe("/px4_multicopter/imu", 1, &AttitudeEstimator::ImuCallback, this)),
_vehicle_attitude_pub(_n.advertise<px4::vehicle_attitude>("vehicle_attitude", 1))
{
std::string vehicle_model;
_n.param("vehicle_model", vehicle_model, std::string("iris"));
_sub_imu = _n.subscribe("/" + vehicle_model + "/imu", 1, &AttitudeEstimator::ImuCallback, this);
}
void AttitudeEstimator::ModelStatesCallback(const gazebo_msgs::ModelStatesConstPtr &msg)