From a98e11aa41430b8813881d4f6213cdb1597b34db Mon Sep 17 00:00:00 2001 From: vivek-shankar Date: Fri, 10 Feb 2017 15:57:25 -0500 Subject: [PATCH] obstacle buzz object --- launch/rosbuzz_2_parallel.launch | 2 +- src/buzz_utility.cpp | 1 + src/buzzuav_closures.cpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/launch/rosbuzz_2_parallel.launch b/launch/rosbuzz_2_parallel.launch index 44841ea..58b42a8 100644 --- a/launch/rosbuzz_2_parallel.launch +++ b/launch/rosbuzz_2_parallel.launch @@ -2,7 +2,7 @@ - + diff --git a/src/buzz_utility.cpp b/src/buzz_utility.cpp index 1222866..edb71c8 100644 --- a/src/buzz_utility.cpp +++ b/src/buzz_utility.cpp @@ -492,6 +492,7 @@ namespace buzz_utility{ buzzuav_closures::buzzuav_update_prox(VM); buzzuav_closures::buzzuav_update_currentpos(VM); buzzuav_closures::buzzuav_update_flight_status(VM); + buzzuav_closures::buzzuav_update_obstacle(VM); /* * Call Buzz step() function */ diff --git a/src/buzzuav_closures.cpp b/src/buzzuav_closures.cpp index 67509876..70c9723 100644 --- a/src/buzzuav_closures.cpp +++ b/src/buzzuav_closures.cpp @@ -12,7 +12,7 @@ namespace buzzuav_closures{ static double goto_pos[3]; static double rc_goto_pos[3]; static float batt[3]; -static float obst[5]; +static float obst[5]={0,0,0,0,0}; static double cur_pos[3]; static uint8_t status; static int cur_cmd = 0; @@ -204,7 +204,7 @@ rc_cmd=rc_cmd_in; void set_obstacle_dist(float dist[]){ for(int i=0; i<5;i++) - dist[i]=obst[i]; + obst[i]=dist[i]; }