add test arming back after 20 setpoints
This commit is contained in:
@@ -255,6 +255,20 @@ private:
|
||||
*/
|
||||
void send_setpoint()
|
||||
{
|
||||
|
||||
setpoint_count++;
|
||||
if (setpoint_count == 20)
|
||||
{
|
||||
this->publish_vehicle_command(px4_msgs::msg::VehicleCommand::VEHICLE_CMD_DO_SET_MODE, 1, 6);
|
||||
RCLCPP_INFO(this->get_logger(), "Set to offboard mode");
|
||||
// arm the drone
|
||||
this->publish_vehicle_command(px4_msgs::msg::VehicleCommand::VEHICLE_CMD_COMPONENT_ARM_DISARM, 1.0, 0);
|
||||
|
||||
RCLCPP_INFO(this->get_logger(), "Arm command sent");
|
||||
this->last_thrust = -0.1; // spin motors at 10% thrust
|
||||
armed = true;
|
||||
}
|
||||
|
||||
RCLCPP_INFO(this->get_logger(), "current values: %f %f %f %f", last_setpoint[0], last_setpoint[1], last_setpoint[2], last_thrust);
|
||||
if (!flying)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user