This commit is contained in:
David St-Onge 2017-01-30 19:09:54 -05:00
parent 1dfc6ad709
commit 97eeef0e79
2 changed files with 6 additions and 6 deletions

View File

@ -110,9 +110,9 @@ int buzzuav_goto(buzzvm_t vm) {
goto_cartesian[1] = dy + cur_pos_cartesian[1]; goto_cartesian[1] = dy + cur_pos_cartesian[1];
goto_cartesian[2] = cur_pos_cartesian[2]; goto_cartesian[2] = cur_pos_cartesian[2];
spherical_coordinates(goto_cartesian, goto_pos); spherical_coordinates(goto_cartesian, goto_pos);
goto_pos[0]=dx; // goto_pos[0]=dx;
goto_pos[1]=dy; // goto_pos[1]=dy;
goto_pos[2]=height; // force a constant altitude // goto_pos[2]=height; // force a constant altitude
cur_cmd=mavros_msgs::CommandCode::NAV_WAYPOINT; cur_cmd=mavros_msgs::CommandCode::NAV_WAYPOINT;
printf(" Buzz requested Go To, to Latitude: %.7f , Longitude: %.7f, Altitude: %.7f \n",goto_pos[0],goto_pos[1],goto_pos[2]); printf(" Buzz requested Go To, to Latitude: %.7f , Longitude: %.7f, Altitude: %.7f \n",goto_pos[0],goto_pos[1],goto_pos[2]);
buzz_cmd=2; buzz_cmd=2;

View File

@ -12,11 +12,11 @@ function updated_neigh(){
neighbors.broadcast(updated, update_no) neighbors.broadcast(updated, update_no)
} }
TARGET_ALTITUDE = 10.0 TARGET_ALTITUDE = 10.01
# Lennard-Jones parameters # Lennard-Jones parameters
TARGET = 5.0 #0.000001001 TARGET = 5.0 #0.000001001
EPSILON = 80.0 #0.001 EPSILON = 20.0 #0.001
# Lennard-Jones interaction magnitude # Lennard-Jones interaction magnitude
function lj_magnitude(dist, target, epsilon) { function lj_magnitude(dist, target, epsilon) {
@ -42,7 +42,7 @@ function hexagon() {
math.vec2.scale(accum, 1.0 / neighbors.count()) math.vec2.scale(accum, 1.0 / neighbors.count())
# Move according to vector # Move according to vector
# print("Robot ", id, "must push ",accum.x, "; ", accum.y) # print("Robot ", id, "must push ",accum.x, "; ", accum.y)
uav_goto(accum.x, accum.y) uav_goto(0.0,0.0) #accum.x, accum.y)
} }
######################################## ########################################