mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-25 23:10:34 +08:00
delete vehicle_global_velocity_setpoint
This commit is contained in:
@@ -58,12 +58,10 @@ MulticopterPositionControlMultiplatform::MulticopterPositionControlMultiplatform
|
||||
/* publications */
|
||||
_att_sp_pub(nullptr),
|
||||
_local_pos_sp_pub(nullptr),
|
||||
_global_vel_sp_pub(nullptr),
|
||||
|
||||
/* outgoing messages */
|
||||
_att_sp_msg(),
|
||||
_local_pos_sp_msg(),
|
||||
_global_vel_sp_msg(),
|
||||
|
||||
_n(_appState),
|
||||
|
||||
@@ -116,8 +114,6 @@ _R()
|
||||
_pos_sp_triplet = _n.subscribe<px4_position_setpoint_triplet>
|
||||
(&MulticopterPositionControlMultiplatform::handle_position_setpoint_triplet, this, 0);
|
||||
_local_pos_sp = _n.subscribe<px4_vehicle_local_position_setpoint>(0);
|
||||
_global_vel_sp = _n.subscribe<px4_vehicle_global_velocity_setpoint>(0);
|
||||
|
||||
|
||||
_params.pos_p.zero();
|
||||
_params.vel_p.zero();
|
||||
@@ -700,18 +696,6 @@ void MulticopterPositionControlMultiplatform::handle_vehicle_attitude(const px4
|
||||
_vel_sp(2) = _params.land_speed;
|
||||
}
|
||||
|
||||
_global_vel_sp_msg.data().vx = _vel_sp(0);
|
||||
_global_vel_sp_msg.data().vy = _vel_sp(1);
|
||||
_global_vel_sp_msg.data().vz = _vel_sp(2);
|
||||
|
||||
/* publish velocity setpoint */
|
||||
if (_global_vel_sp_pub != nullptr) {
|
||||
_global_vel_sp_pub->publish(_global_vel_sp_msg);
|
||||
|
||||
} else {
|
||||
_global_vel_sp_pub = _n.advertise<px4_vehicle_global_velocity_setpoint>();
|
||||
}
|
||||
|
||||
if (_control_mode->data().flag_control_climb_rate_enabled || _control_mode->data().flag_control_velocity_enabled) {
|
||||
/* reset integrals if needed */
|
||||
if (_control_mode->data().flag_control_climb_rate_enabled) {
|
||||
|
||||
@@ -88,9 +88,6 @@ protected:
|
||||
|
||||
Publisher<px4_vehicle_attitude_setpoint> *_att_sp_pub; /**< attitude setpoint publication */
|
||||
Publisher<px4_vehicle_local_position_setpoint> *_local_pos_sp_pub; /**< vehicle local position setpoint publication */
|
||||
Publisher<px4_vehicle_global_velocity_setpoint>
|
||||
*_global_vel_sp_pub; /**< vehicle global velocity setpoint publication */
|
||||
|
||||
|
||||
Subscriber<px4_vehicle_attitude> *_att; /**< vehicle attitude */
|
||||
Subscriber<px4_vehicle_control_mode> *_control_mode; /**< vehicle control mode */
|
||||
@@ -100,11 +97,9 @@ protected:
|
||||
Subscriber<px4_vehicle_local_position> *_local_pos; /**< local position */
|
||||
Subscriber<px4_position_setpoint_triplet> *_pos_sp_triplet; /**< local position */
|
||||
Subscriber<px4_vehicle_local_position_setpoint> *_local_pos_sp; /**< local position */
|
||||
Subscriber<px4_vehicle_global_velocity_setpoint> *_global_vel_sp; /**< local position */
|
||||
|
||||
px4_vehicle_attitude_setpoint _att_sp_msg;
|
||||
px4_vehicle_local_position_setpoint _local_pos_sp_msg;
|
||||
px4_vehicle_global_velocity_setpoint _global_vel_sp_msg;
|
||||
|
||||
px4::NodeHandle _n;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user