@@ -286,7 +286,7 @@ int main(int argc, char **argv) {
286286 }
287287
288288 if (last_msg == nullptr ) {
289- ROS_ERROR ( " MotionPlanner: No obstacle information available, can't build map" );
289+ ROS_DEBUG_THROTTLE ( 30 , " MotionPlanner: No obstacle information available, can't build map" );
290290 } else {
291291 // get a new goal from action server
292292 if (server.isNewGoalAvailable ()) {
@@ -297,11 +297,11 @@ int main(int argc, char **argv) {
297297 goal_ = server.acceptNewGoal ();
298298
299299 // offset by start pose so that we never "go out" of arena
300- double x_offset = -goal_-> start . motion_point . pose . position . x ;
301- double y_offset = -goal_-> start . motion_point . pose . position . y ;
300+ double x_offset = 10 ;
301+ double y_offset = 10 ;
302302
303- pose_start.x = 0.0 ;
304- pose_start.y = 0.0 ;
303+ pose_start.x = goal_-> start . motion_point . pose . position . x + x_offset ;
304+ pose_start.y = goal_-> start . motion_point . pose . position . y + y_offset ;
305305 pose_start.z = goal_->start .motion_point .pose .position .z ;
306306
307307 twist_start = goal_->start .motion_point .twist .linear ;
@@ -356,17 +356,17 @@ int main(int argc, char **argv) {
356356 for (float r = 0 ; r < pipe_radius; r += map_res) {
357357 px = r * std::cos (theta) + pipe_x + voxel_map_origin[0 ];
358358 py = r * std::sin (theta) + pipe_y + voxel_map_origin[1 ];
359- Vec3f pt (px, py, std::min (max_arena_limits[ 2 ], pz + buffer) );
359+ Vec3f pt (px, py, pz );
360360 pts.push_back (pt);
361361 }
362362 }
363363 }
364364 }
365365
366366 std::array<decimal_t , 3 > voxel_map_dim =
367- {map. dim . x * map_res ,
368- map. dim . y * map_res ,
369- map. dim . z * map_res };
367+ {max_arena_limits[ 0 ] ,
368+ max_arena_limits[ 1 ] ,
369+ max_arena_limits[ 2 ] };
370370
371371 std::unique_ptr<VoxelGrid> voxel_grid (
372372 new VoxelGrid (voxel_map_origin, voxel_map_dim, map_res));
@@ -383,7 +383,7 @@ int main(int argc, char **argv) {
383383
384384 map_util->setMap (ori, dim, map.data , map_res);
385385
386- ROS_INFO ( " Takes %f sec for building and setting map" ,
386+ ROS_DEBUG_THROTTLE ( 30 , " Takes %f sec for building and setting map" ,
387387 (ros::WallTime::now () - t1).toSec ());
388388
389389 iarc7_msgs::PlanResult result_;
0 commit comments