mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 12:30:27 +08:00
parametrize imu input for ros dummy att estimator
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
<param name="MPC_XY_VEL_I" type="double" value="0.0" />
|
<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_D" type="double" value="0.01" />
|
||||||
<param name="MPC_XY_VEL_MAX" type="double" value="2.0" />
|
<param name="MPC_XY_VEL_MAX" type="double" value="2.0" />
|
||||||
|
<param name="vehicle_model" type="string" value="ardrone" />
|
||||||
</group>
|
</group>
|
||||||
|
|
||||||
</launch>
|
</launch>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<launch>
|
<launch>
|
||||||
|
|
||||||
<include file="$(find mav_gazebo)/launch/ardrone_empty_world_with_joy.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" />
|
<include file="$(find px4)/launch/ardrone.launch" />
|
||||||
|
|
||||||
</launch>
|
</launch>
|
||||||
|
|||||||
@@ -48,9 +48,11 @@
|
|||||||
AttitudeEstimator::AttitudeEstimator() :
|
AttitudeEstimator::AttitudeEstimator() :
|
||||||
_n(),
|
_n(),
|
||||||
// _sub_modelstates(_n.subscribe("/gazebo/model_states", 1, &AttitudeEstimator::ModelStatesCallback, this)),
|
// _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))
|
_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)
|
void AttitudeEstimator::ModelStatesCallback(const gazebo_msgs::ModelStatesConstPtr &msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user