1
- /*
1
+ /*
2
2
* Copyright (C)2011 Department of Robotics Brain and Cognitive Sciences - Istituto Italiano di Tecnologia
3
3
* Author: Marco Randazzo
4
4
* email: marco.randazzo@iit.it
29
29
#include < yarp/os/PeriodicThread.h>
30
30
#include < yarp/dev/IRangefinder2D.h>
31
31
#include < yarp/dev/INavigation2D.h>
32
+ #include < yarp/sig/LaserMeasurementData.h>
32
33
#include < string>
33
34
34
35
#define _USE_MATH_DEFINES
@@ -75,7 +76,7 @@ bool PlannerThread::readLocalizationData()
75
76
yCWarning (PATHPLAN_CTRL) << " Current map name (" <<m_current_map.getMapName ()<<" ) != m_localization_data.map_id (" << m_localization_data.map_id <<" )" ;
76
77
yCInfo (PATHPLAN_CTRL) << " Asking the map '" << m_localization_data.map_id << " ' to the MAP server" ;
77
78
bool b = reloadCurrentMap ();
78
-
79
+
79
80
yarp::os::Time::delay (1.0 );
80
81
if (b){return true ;}
81
82
else { return true ; // consider changing this to false
@@ -110,7 +111,7 @@ bool PlannerThread::internal_controller_t::readInnerNavigationStatus()
110
111
{
111
112
if (yarp::os::Time::now () - last_print_time > 1.0 )
112
113
{
113
- yCError (PATHPLAN_CTRL) << " Inner status = error" ;
114
+ yCError (PATHPLAN_CTRL) << " Inner status = error" ;
114
115
yarp::os::Time::delay (1.0 );
115
116
last_print_time = yarp::os::Time::now ();
116
117
}
@@ -121,7 +122,7 @@ bool PlannerThread::internal_controller_t::readInnerNavigationStatus()
121
122
122
123
void PlannerThread::readLaserData ()
123
124
{
124
- std::vector<LaserMeasurementData> scan;
125
+ std::vector<yarp::sig:: LaserMeasurementData> scan;
125
126
bool ret = m_iLaser->getLaserMeasurement (scan);
126
127
127
128
if (ret)
@@ -180,7 +181,7 @@ bool prepare_image(IplImage* & image_to_be_prepared, const IplImage* template_im
180
181
yCError (PATHPLAN_CTRL) << " PlannerThread::draw_map cannot copy an empty image!" ;
181
182
return false ;
182
183
}
183
- if (image_to_be_prepared == 0 )
184
+ if (image_to_be_prepared == 0 )
184
185
{
185
186
image_to_be_prepared = cvCloneImage (template_image);
186
187
}
@@ -222,7 +223,7 @@ void PlannerThread::run()
222
223
if (err == false )
223
224
yCInfo (PATHPLAN_CTRL) << " robotPathPlanner running, ALL ok. Navigation status:" << this ->getNavigationStatusAsString ();
224
225
}
225
-
226
+
226
227
m_mutex.wait ();
227
228
// double check1 = yarp::os::Time::now();
228
229
readLocalizationData ();
@@ -582,7 +583,7 @@ void PlannerThread::run()
582
583
b.addString (s.c_str ());
583
584
m_port_status_output.write ();
584
585
}
585
-
586
+
586
587
m_mutex.post ();
587
588
}
588
589
@@ -672,7 +673,7 @@ bool PlannerThread::getCurrentPath(yarp::dev::Nav2D::Map2DPath& current_path) c
672
673
return false ;
673
674
}
674
675
675
- bool PlannerThread::getOstaclesMap (MapGrid2D& obstacles_map)
676
+ bool PlannerThread::getOstaclesMap (MapGrid2D& obstacles_map)
676
677
{
677
678
m_temporary_obstacles_map_mutex.lock ();
678
679
obstacles_map = m_temporary_obstacles_map;
@@ -759,7 +760,7 @@ bool PlannerThread::startPath()
759
760
start.y = 150 ;// &&&&&
760
761
#endif
761
762
double t1 = yarp::os::Time::now ();
762
- // clear the memory
763
+ // clear the memory
763
764
m_computed_path.clear ();
764
765
m_computed_simplified_path.clear ();
765
766
m_planner_status = navigation_status_thinking;
0 commit comments