Skip to content
Snippets Groups Projects
Commit 8ec124b4 authored by bucyril's avatar bucyril
Browse files

adsölfj

parent 20896760
No related branches found
No related tags found
No related merge requests found
...@@ -52,8 +52,8 @@ CrazyflieData previousLocation; ...@@ -52,8 +52,8 @@ CrazyflieData previousLocation;
//circle stuff //circle stuff
float currentTime; float currentTime;
const float OMEGA = 0.5*2*PI; const float OMEGA = 0.25*2*PI;
const float RADIUS = 0.35; const float RADIUS = 0.25;
//point publisher for FollowCrazyflieService //point publisher for FollowCrazyflieService
ros::Publisher followPublisher; ros::Publisher followPublisher;
...@@ -146,7 +146,7 @@ void convertIntoBodyFrame(float est[9], float (&state)[9], float yaw_measured) { ...@@ -146,7 +146,7 @@ void convertIntoBodyFrame(float est[9], float (&state)[9], float yaw_measured) {
void calculateCircle(Setpoint &circlePoint){ void calculateCircle(Setpoint &circlePoint){
circlePoint.x = RADIUS*cos(OMEGA*currentTime); circlePoint.x = RADIUS*cos(OMEGA*currentTime);
circlePoint.y = RADIUS*sin(OMEGA*currentTime); circlePoint.y = RADIUS*sin(OMEGA*currentTime);
circlePoint.z = 0.5; circlePoint.z = 0;
circlePoint.yaw = OMEGA*currentTime; circlePoint.yaw = OMEGA*currentTime;
} }
...@@ -207,7 +207,13 @@ bool calculateControlOutput(Controller::Request &request, Controller::Response & ...@@ -207,7 +207,13 @@ bool calculateControlOutput(Controller::Request &request, Controller::Response &
previousLocation = request.ownCrazyflie; previousLocation = request.ownCrazyflie;
followPublisher.publish(previousLocation); Setpoint pubSetpoint;
pubSetpoint.x = previousLocation.x;
pubSetpoint.y = previousLocation.y;
pubSetpoint.z = previousLocation.z;
pubSetpoint.yaw = previousLocation.yaw;
followPublisher.publish(pubSetpoint);
return true; return true;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment