Go to the documentation of this file.
28 std::istream& in_stream,
29 std::vector<mrpt::obs::CObservation::Ptr>& out_observations,
35 out_observations.clear();
41 if (!in_stream)
return false;
42 std::getline(in_stream, line);
55 mrpt::make_aligned_shared<CObservation2DRangeScan>();
62 double start_angle, angular_resolution, accuracy;
65 if (!(S >> obsLaser->
sensorLabel >> laser_type >> start_angle >>
67 accuracy >> remission_mode))
69 "Error parsing line from CARMEN log (params):\n'%s'\n",
77 for (
size_t i = 0; i < nRanges; i++)
82 "Error parsing line from CARMEN log (ranges):\n'%s'\n",
88 obsLaser->
scan[i] <= 0));
91 size_t remmision_count;
92 if (!(S >> remmision_count))
94 "Error parsing line from CARMEN log (remmision_count):\n'%s'\n",
97 vector<double> remission;
98 remission.resize(remmision_count);
100 for (
size_t i = 0; i < remmision_count; i++)
102 if (!(S >> remission[i]))
104 "Error parsing line from CARMEN log (remmision "
112 if (!(S >> globalLaserPose.
x >> globalLaserPose.
y >>
113 globalLaserPose.
phi >> globalRobotPose.
x >> globalRobotPose.
y >>
114 globalRobotPose.
phi))
116 "Error parsing line from CARMEN log (poses):\n'%s'\n",
123 double tv, rv, fw_dist, side_dist, turn_axis;
124 S >> tv >> rv >> fw_dist >> side_dist >> turn_axis;
128 S >> timestamp >> robotName;
139 mrpt::make_aligned_shared<CObservationOdometry>();
141 obsOdo_ptr->timestamp = obs_time;
142 obsOdo_ptr->odometry =
CPose2D(globalRobotPose);
143 obsOdo_ptr->sensorLabel =
"ODOMETRY";
145 out_observations.push_back(obsOdo_ptr);
149 out_observations.push_back(obsLaser_ptr);
158 std::istringstream S;
162 mrpt::make_aligned_shared<CObservation2DRangeScan>();
171 "Error parsing line from CARMEN log (params):\n'%s'\n",
176 double maxRange = 81.0;
177 double resolutionDeg = 0.5;
183 .getWithDefaultVal(
"robot_front_laser_max",
"81.0")
185 resolutionDeg = atof(
188 "laser_front_laser_resolution",
"0.5")
191 else if (line[0] ==
'R')
195 .getWithDefaultVal(
"robot_rear_laser_max",
"81.0")
197 resolutionDeg = atof(
200 "laser_rear_laser_resolution",
"0.5")
209 for (
size_t i = 0; i < nRanges; i++)
214 "Error parsing line from CARMEN log (ranges):\n'%s'\n",
220 obsLaser->
scan[i] <= 0));
225 if (!(S >> globalLaserPose.
x >> globalLaserPose.
y >>
226 globalLaserPose.
phi >> globalRobotPose.
x >> globalRobotPose.
y >>
227 globalRobotPose.
phi))
229 "Error parsing line from CARMEN log (poses):\n'%s'\n",
238 S >> timestamp >> robotName;
249 mrpt::make_aligned_shared<CObservationOdometry>();
251 obsOdo_ptr->timestamp = obs_time;
252 obsOdo_ptr->odometry =
CPose2D(globalRobotPose);
253 obsOdo_ptr->sensorLabel =
"ODOMETRY";
255 out_observations.push_back(obsOdo_ptr);
259 out_observations.push_back(obsLaser_ptr);
266 std::istringstream S;
272 if (!(S >> key >>
val))
274 "Error parsing line from CARMEN log (PARAM):\n'%s'\n",
277 if (!key.empty() && !
val.empty())
std::string sensorLabel
An arbitrary label that can be used to identify the sensor.
void setScanRange(const size_t i, const float val)
mrpt::system::TTimeStamp secondsToTimestamp(const double nSeconds)
Transform a time interval (in seconds) into TTimeStamp (e.g.
float maxRange
The maximum range allowed by the device, in meters (e.g.
static std::string & trim(std::string &s)
std::shared_ptr< CObservationOdometry > Ptr
bool strStartsI(const std::string &str, const std::string &subStr)
Return true if "str" starts with "subStr" (case insensitive)
A "CObservation"-derived class that represents a 2D range scan measurement (typically from a laser sc...
double phi
Orientation (rads)
#define THROW_EXCEPTION_FMT(_FORMAT_STRING,...)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
void resizeScan(const size_t len)
Resizes all data vectors to allocate a given number of scan rays.
void setScanRangeValidity(const size_t i, const bool val)
Classes for 2D/3D geometry representation, both of single values and probability density distribution...
This namespace contains representation of robot actions and observations.
std::string lowerCase(const std::string &str)
Returns an lower-case version of a string.
mrpt::system::TTimeStamp timestamp
The associated UTC time-stamp.
uint64_t TTimeStamp
A system independent time type, it holds the the number of 100-nanosecond intervals since January 1,...
bool carmen_log_parse_line(std::istream &in_stream, std::vector< mrpt::obs::CObservation::Ptr > &out_imported_observations, const mrpt::system::TTimeStamp &time_start_log)
Parse one line from an text input stream and interpret it as a CARMEN log entry, returning its MRPT o...
float aperture
The "aperture" or field-of-view of the range finder, in radians (typically M_PI = 180 degrees).
For usage when passing a dynamic number of (numeric) arguments to a function, by name.
A class used to store a 2D pose, including the 2D coordinate point and a heading (phi) angle.
A class used to store a 3D pose (a 3D translation + a rotation in 3D).
std::shared_ptr< CObservation2DRangeScan > Ptr
mrpt::containers::ContainerReadOnlyProxyAccessor< mrpt::aligned_std_vector< float > > scan
The range values of the scan, in meters.
mrpt::poses::CPose3D sensorPose
The 6D pose of the sensor on the robot at the moment of starting the scan.
This namespace provides a OS-independent interface to many useful functions: filenames manipulation,...
double DEG2RAD(const double x)
Degrees to radians.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST | |