[Positioning] RealPosition: handle non-calib. requests
RealPosition is now able to return a relevant result when called with non-calibration requests.
This commit is contained in:
parent
17e12a9735
commit
0eef6e8577
|
@ -6,16 +6,18 @@
|
|||
|
||||
Result RealPosition::compute(const Request &request)
|
||||
{
|
||||
const Point3D *coordinates = NULL ;
|
||||
|
||||
const CalibrationRequest *calibration_request =
|
||||
dynamic_cast<const CalibrationRequest*>(&request) ;
|
||||
|
||||
if (calibration_request != NULL)
|
||||
{
|
||||
Point3D *coordinates =
|
||||
static_cast<Point3D*>(
|
||||
calibration_request->get_reference_point()) ;
|
||||
return Result(*coordinates, name) ;
|
||||
}
|
||||
coordinates = static_cast<Point3D*>(
|
||||
calibration_request->get_reference_point()) ;
|
||||
|
||||
coordinates = request.get_real_position() ;
|
||||
if (coordinates)
|
||||
return Result(*coordinates, name) ;
|
||||
|
||||
return Result(name) ;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue