You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#include "class_model/mission.h"
|
|
|
|
|
|
MissionClass::MissionClass() : node_handle_(""){
|
|
|
|
|
|
}
|
|
|
|
MissionClass::~MissionClass() { ros::shutdown(); }
|
|
|
|
void MissionClass::fly2target(float x,float y){
|
|
select_formation.protect_formation(x,y);
|
|
sleep(1);
|
|
select_formation.protect_formation(-x,-y);
|
|
// select_formation.stop();
|
|
ROS_INFO("-----------------------");
|
|
}
|
|
|
|
void MissionClass::cruise(float x, float y){
|
|
|
|
// select_formation.protect_formation(0,y);
|
|
// sleep(1);
|
|
// select_formation.protect_formation(-x,0);
|
|
// sleep(1);
|
|
// select_formation.protect_formation(0,-y);
|
|
// sleep(1);
|
|
// select_formation.protect_formation(x,0);
|
|
// sleep(1);
|
|
|
|
select_formation.init_formation(0,y);
|
|
sleep(1);
|
|
select_formation.init_formation(-x,0);
|
|
sleep(1);
|
|
select_formation.init_formation(0,-y);
|
|
sleep(1);
|
|
select_formation.init_formation(x,0);
|
|
sleep(1);
|
|
}
|
|
|
|
void MissionClass::snake(float x, float y){
|
|
|
|
select_formation.line_formation(0,y);
|
|
sleep(1);
|
|
select_formation.line_formation(-x,0);
|
|
sleep(1);
|
|
select_formation.line_formation(0,-y);
|
|
sleep(1);
|
|
select_formation.line_formation(x,0);
|
|
sleep(1);
|
|
}
|
|
|
|
void MissionClass::start(){
|
|
|
|
select_formation.start_formation();
|
|
|
|
} |