Carma-platform v4.2.0
CARMA Platform is built on robot operating system (ROS) and utilizes open source software (OSS) that enables Cooperative Driving Automation (CDA) features to allow Automated Driving Systems to interact and cooperate with infrastructure and other vehicles through communication.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
motion_computation::conversion::impl Namespace Reference

Functions

std::pair< carma_perception_msgs::msg::PredictedState, double > composePredictedState (const tf2::Vector3 &curr_pt, const tf2::Vector3 &prev_pt, const rclcpp::Time &prev_time_stamp, const rclcpp::Time &curr_time_stamp, double prev_yaw)
 Composes a PredictedState message form a provided current point and previous point. It calculates the speed from these points using mobility_path_time_step. More...
 
void calculateAngVelocityOfPredictedStates (carma_perception_msgs::msg::ExternalObject &object)
 Helper function to fill in the angular velocity of the external object. More...
 
double getYawFromQuaternionMsg (const geometry_msgs::msg::Quaternion &quaternion)
 Gets the yaw angle in degrees described by the provided quaternion. More...
 
tf2::Vector3 transform_to_map_frame (const tf2::Vector3 &ecef_point, const lanelet::projection::LocalFrameProjector &map_projector)
 Transforms ecef point to map frame using internally saved map transform. More...
 
std::vector< geometry_msgs::msg::Pose > sample_2d_path_from_radius (const geometry_msgs::msg::Pose &pose, double velocity, double radius_of_curvature, double period, double step_size)
 
std::vector< geometry_msgs::msg::Pose > sample_2d_linear_motion (const geometry_msgs::msg::Pose &pose, double velocity, double period, double step_size)
 
geometry_msgs::msg::PoseWithCovariance pose_from_gnss (const lanelet::projection::LocalFrameProjector &projector, const tf2::Quaternion &ned_in_map_rotation, const lanelet::GPSPoint &gps_point, const double &heading, const double lat_variance, const double lon_variance, const double heading_variance)
 
std::vector< carma_perception_msgs::msg::PredictedState > predicted_poses_to_predicted_state (const std::vector< geometry_msgs::msg::Pose > &poses, double constant_velocity, const rclcpp::Time &start_time, const rclcpp::Duration &step_size, const std::string &frame, double initial_pose_confidence, double initial_vel_confidence)
 
rclcpp::Time get_psm_timestamp (const carma_v2x_msgs::msg::PSM &in_msg, rclcpp::Clock::SharedPtr clock)
 

Function Documentation

◆ calculateAngVelocityOfPredictedStates()

void motion_computation::conversion::impl::calculateAngVelocityOfPredictedStates ( carma_perception_msgs::msg::ExternalObject &  object)

Helper function to fill in the angular velocity of the external object.

Parameters
ExternalObjectto fill in its angular velocities

Definition at line 212 of file mobility_path_to_external_object.cpp.

213{
214 if (!object.dynamic_obj || object.predictions.size() == 0) {
215 return;
216 }
217
218 // Object's current angular velocity
219 double dt = (rclcpp::Time(object.header.stamp) - rclcpp::Time(object.predictions[0].header.stamp))
220 .seconds();
221 object.velocity.twist.angular.z =
222 (impl::getYawFromQuaternionMsg(object.pose.pose.orientation) -
223 impl::getYawFromQuaternionMsg(object.predictions[0].predicted_position.orientation)) /
224 dt;
225
226 // Predictions' angular velocities
227 auto prev_orient = object.pose.pose.orientation;
228 auto prev_time = rclcpp::Time(object.predictions[0].header.stamp);
229 for (auto & pred : object.predictions) {
230 dt = (rclcpp::Time(pred.header.stamp) - prev_time).seconds();
231 pred.predicted_velocity.angular.z =
232 (impl::getYawFromQuaternionMsg(prev_orient) -
233 impl::getYawFromQuaternionMsg(pred.predicted_position.orientation)) /
234 dt;
235 }
236}
double getYawFromQuaternionMsg(const geometry_msgs::msg::Quaternion &quaternion)
Gets the yaw angle in degrees described by the provided quaternion.

References getYawFromQuaternionMsg().

Referenced by motion_computation::conversion::convert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ composePredictedState()

std::pair< carma_perception_msgs::msg::PredictedState, double > motion_computation::conversion::impl::composePredictedState ( const tf2::Vector3 &  curr_pt,
const tf2::Vector3 &  prev_pt,
const rclcpp::Time &  prev_time_stamp,
const rclcpp::Time &  curr_time_stamp,
double  prev_yaw 
)

Composes a PredictedState message form a provided current point and previous point. It calculates the speed from these points using mobility_path_time_step.

Parameters
curr_ptcurrent point
prev_ptprev_pt. this point is recorded in the state
prev_time_stampprev_pt's time stamp. This time is recorded in the state
curr_time_stampThe timestamp of the second point when used to compute velocity at prev point
prev_yawA previous yaw value in radians to use if the two provided points are equivalent
Returns
std::pair<carma_perception_msgs::msg::PredictedState,double> where the first element is the prediction including linear velocity, last_time, orientation filled in and the second element is the yaw in radians used to compute the orientation

Definition at line 167 of file mobility_path_to_external_object.cpp.

170{
171 carma_perception_msgs::msg::PredictedState output_state;
172 // Set Position
173 output_state.predicted_position.position.x = prev_pt.x();
174 output_state.predicted_position.position.y = prev_pt.y();
175 output_state.predicted_position.position.z = prev_pt.z();
176
177 // Set Orientation
178 Eigen::Vector2d vehicle_vector = {curr_pt.x() - prev_pt.x(), curr_pt.y() - prev_pt.y()};
179 Eigen::Vector2d x_axis = {1, 0};
180 double yaw = 0.0;
181 if (
182 vehicle_vector.norm() <
183 0.000001) { // If there is zero magnitude use previous yaw to avoid divide by 0
184 yaw = prev_yaw;
185 RCLCPP_DEBUG_STREAM(
186 rclcpp::get_logger("motion_computation::conversion"),
187 "Two identical points sent for predicting heading. Forced to use previous yaw or 0 if "
188 "first "
189 "point");
190 } else {
191 yaw = std::acos(vehicle_vector.dot(x_axis) / (vehicle_vector.norm() * x_axis.norm()));
192 }
193
194 tf2::Quaternion vehicle_orientation;
195 vehicle_orientation.setRPY(0, 0, yaw);
196 output_state.predicted_position.orientation.x = vehicle_orientation.getX();
197 output_state.predicted_position.orientation.y = vehicle_orientation.getY();
198 output_state.predicted_position.orientation.z = vehicle_orientation.getZ();
199 output_state.predicted_position.orientation.w = vehicle_orientation.getW();
200
201 // Set velocity
202 output_state.predicted_velocity.linear.x =
203
204 vehicle_vector.norm() / (curr_time_stamp - prev_time_stamp).seconds();
205
206 // Set timestamp
207 output_state.header.stamp = builtin_interfaces::msg::Time(prev_time_stamp);
208
209 return std::make_pair(output_state, yaw);
210}

Referenced by motion_computation::conversion::convert().

Here is the caller graph for this function:

◆ get_psm_timestamp()

rclcpp::Time motion_computation::conversion::impl::get_psm_timestamp ( const carma_v2x_msgs::msg::PSM &  in_msg,
rclcpp::Clock::SharedPtr  clock 
)

Definition at line 477 of file psm_to_external_object_convertor.cpp.

479{
480 boost::posix_time::ptime utc_time_of_current_psm;
481
482 // Get the utc epoch start time
483 static const boost::posix_time::ptime inception_boost(
484 boost::posix_time::time_from_string("1970-01-01 00:00:00.000"));
485
486 // Determine if the utc time of the path history can be used instead of the
487 // sec_mark The sec_mark is susceptible to large error on minute transitions
488 // due to missing "minute of the year" field If the second mark in the path
489 // history is identical and the full utc time is provided with ms resolution
490 // then it can be assumed the initial_position is the same as the PSM data and
491 // the utc_time can be used instead of sec_mark
492 // clang-format off
493
494 const auto initial_position_time{in_msg.path_history.initial_position.utc_time};
495 if ((in_msg.presence_vector &
496 carma_v2x_msgs::msg::PSM::HAS_PATH_HISTORY) &&
497 (in_msg.path_history.presence_vector &
498 carma_v2x_msgs::msg::PathHistory::HAS_INITIAL_POSITION) &&
499 (initial_position_time.presence_vector & j2735_v2x_msgs::msg::DDateTime::YEAR) &&
500 (initial_position_time.presence_vector & j2735_v2x_msgs::msg::DDateTime::MONTH) &&
501 (initial_position_time.presence_vector & j2735_v2x_msgs::msg::DDateTime::DAY) &&
502 (initial_position_time.presence_vector & j2735_v2x_msgs::msg::DDateTime::HOUR) &&
503 (initial_position_time.presence_vector & j2735_v2x_msgs::msg::DDateTime::MINUTE) &&
504 (initial_position_time.presence_vector & j2735_v2x_msgs::msg::DDateTime::SECOND) &&
505 (in_msg.sec_mark.millisecond == initial_position_time.second.millisecond)) {
506 // clang-format on
507 RCLCPP_DEBUG_STREAM(
508 rclcpp::get_logger("motion_computation::conversion"),
509 "Using UTC time of path history to determine PSM "
510 "timestamp. Assumed valid since UTC is fully specified "
511 "and sec_mark == utc_time.seconds in this message.");
512
513 boost::posix_time::time_duration time_of_day =
514 boost::posix_time::hours(in_msg.path_history.initial_position.utc_time.hour.hour) +
515 boost::posix_time::minutes(in_msg.path_history.initial_position.utc_time.minute.minute) +
516 boost::posix_time::milliseconds(
517 in_msg.path_history.initial_position.utc_time.second.millisecond);
518
519 boost::gregorian::date utc_day(
520 in_msg.path_history.initial_position.utc_time.year.year,
521 in_msg.path_history.initial_position.utc_time.month.month,
522 in_msg.path_history.initial_position.utc_time.day.day);
523
524 utc_time_of_current_psm = boost::posix_time::ptime(utc_day) + time_of_day;
525 } else { // If the utc time of the path history cannot be used to account for minute
526 // change over, then we have to default to the sec mark
527
528 RCLCPP_WARN_STREAM_THROTTLE(
529 rclcpp::get_logger("motion_computation::conversion"), *clock.get(),
530 rclcpp::Duration(5, 0).nanoseconds(),
531 "PSM PathHistory utc timstamp does not match "
532 "sec_mark. Unable to determine the minute of "
533 "the year used for PSM data. Assuming local "
534 "clock is exactly synced. This is NOT "
535 "ADVISED.");
536
537 // Get the current ROS time
538 auto current_time = clock->now();
539
540 // Convert the ros time to a boost duration
541 boost::posix_time::time_duration duration_since_inception(
542 lanelet::time::durationFromSec(current_time.seconds()));
543
544 // Get the current ROS time in UTC
545 auto curr_time_boost = inception_boost + duration_since_inception;
546
547 // Get duration of current day
548 auto duration_in_day_till_current_time = curr_time_boost.time_of_day();
549
550 // Extract hours and minutes
551 auto hour_count_in_day = duration_in_day_till_current_time.hours();
552 auto minute_count_in_hour = duration_in_day_till_current_time.minutes();
553
554 // Get the duration of the minute in the day
555 auto start_of_minute_in_day = boost::posix_time::hours(hour_count_in_day) +
556 boost::posix_time::minutes(minute_count_in_hour);
557
558 // Get the start of the day in ROS time
559 boost::posix_time::ptime start_of_day(curr_time_boost.date());
560
561 // Ge the start of the current minute in ROS time
562 boost::posix_time::ptime utc_start_of_current_minute = start_of_day + start_of_minute_in_day;
563
564 // Compute the UTC PSM stamp from the sec_mark using ROS time as the clock
565
566 boost::posix_time::time_duration s_in_cur_minute =
567 boost::posix_time::milliseconds(in_msg.sec_mark.millisecond);
568
569 utc_time_of_current_psm = utc_start_of_current_minute + s_in_cur_minute;
570 }
571
572 boost::posix_time::time_duration nsec_since_epoch = utc_time_of_current_psm - inception_boost;
573
574 if (nsec_since_epoch.is_special()) {
575 RCLCPP_ERROR_STREAM(
576 rclcpp::get_logger("motion_computation::conversion"),
577 "Computed psm nsec_since_epoch is special (computation "
578 "failed). Value effectively undefined.");
579 }
580
581 return rclcpp::Time(nsec_since_epoch.total_nanoseconds());
582}

Referenced by motion_computation::conversion::convert().

Here is the caller graph for this function:

◆ getYawFromQuaternionMsg()

double motion_computation::conversion::impl::getYawFromQuaternionMsg ( const geometry_msgs::msg::Quaternion &  quaternion)

Gets the yaw angle in degrees described by the provided quaternion.

Parameters
quaternionThe quaternion to extract yaw from
Returns
The yaw in degrees

Definition at line 238 of file mobility_path_to_external_object.cpp.

239{
240 tf2::Quaternion orientation;
241 orientation.setX(quaternion.x);
242 orientation.setY(quaternion.y);
243 orientation.setZ(quaternion.z);
244 orientation.setW(quaternion.w);
245
246 double roll;
247 double pitch;
248 double yaw;
249 tf2::Matrix3x3(orientation).getRPY(roll, pitch, yaw);
250
251 return yaw;
252}

Referenced by calculateAngVelocityOfPredictedStates().

Here is the caller graph for this function:

◆ pose_from_gnss()

geometry_msgs::msg::PoseWithCovariance motion_computation::conversion::impl::pose_from_gnss ( const lanelet::projection::LocalFrameProjector &  projector,
const tf2::Quaternion &  ned_in_map_rotation,
const lanelet::GPSPoint &  gps_point,
const double &  heading,
const double  lat_variance,
const double  lon_variance,
const double  heading_variance 
)

Convert the position information into the map frame using the proj library

Convert the position information into the map frame using the proj library

Definition at line 340 of file psm_to_external_object_convertor.cpp.

345{
348 lanelet::BasicPoint3d map_point = projector.forward(gps_point);
349
350 RCLCPP_DEBUG_STREAM(
351 rclcpp::get_logger("motion_computation::conversion"),
352 "map_point: " << map_point.x() << ", " << map_point.y() << ", " << map_point.z());
353
354 if (
355 fabs(map_point.x()) > 10000.0 ||
356 fabs(map_point.y()) > 10000.0) { // Above 10km from map origin earth curvature will start to
357 // have a negative impact on system performance
358
359 RCLCPP_WARN_STREAM(
360 rclcpp::get_logger("motion_computation::conversion"),
361 "Distance from map origin is larger than supported by system "
362 "assumptions. Strongly advise "
363 "alternative map origin be used. ");
364 }
365
367 // This logic assumes that the orientation difference between an NED frame
368 // located at the map origin and an NED frame located at the GNSS point are
369 // sufficiently small that they can be ignored. Therefore it is assumed the
370 // heading report of the GNSS system regardless of its postion in the map
371 // without change in its orientation will give the same result (as far as we
372 // are concered).
373
374 tf2::Quaternion R_m_n(ned_in_map_rotation); // Rotation of NED frame in map
375 // frame
376 tf2::Quaternion R_n_h; // Rotation of sensor heading report in NED frame
377 R_n_h.setRPY(0, 0, heading * wgs84_utils::DEG2RAD);
378
379 tf2::Quaternion R_m_s = R_m_n * R_n_h; // Rotation of sensor in map frame under assumption that
380 // distance from map origin is sufficiently small so as to
381 // ignore local changes in NED orientation
382
383 RCLCPP_DEBUG_STREAM(
384 rclcpp::get_logger("motion_computation::conversion"),
385 "R_m_n (x,y,z,w) : ( " << R_m_n.x() << ", " << R_m_n.y() << ", " << R_m_n.z() << ", "
386 << R_m_n.w());
387
388 RCLCPP_DEBUG_STREAM(
389 rclcpp::get_logger("motion_computation::conversion"),
390 "R_n_h (x,y,z,w) : ( " << R_n_h.x() << ", " << R_n_h.y() << ", " << R_n_h.z() << ", "
391 << R_n_h.w());
392
393 RCLCPP_DEBUG_STREAM(
394 rclcpp::get_logger("motion_computation::conversion"),
395 "R_m_s (x,y,z,w) : ( " << R_m_s.x() << ", " << R_m_s.y() << ", " << R_m_s.z() << ", "
396 << R_m_s.w());
397
398 tf2::Transform T_m_s(
399 R_m_s, tf2::Vector3(
400 map_point.x(), map_point.y(),
401 map_point.z())); // Reported position and orientation
402 // of sensor frame in map frame
403
404 tf2::Transform T_m_n_no_heading(
405 R_m_n, tf2::Vector3(0, 0, 0)); // Used to transform the covariance
406
407 // This covariance represents the covariance of the NED frame N-lat,
408 // E-lon, heading- angle east of north This means that the covariance is
409 // in the NED frame, and needs to be transformed to the map frame
410 // clang-format off
411 std::array<double, 36> input_covariance = {
412 lat_variance, 0, 0, 0, 0, 0,
413 0, lon_variance, 0, 0, 0, 0,
414 0, 0, 1, 0, 0, 0,
415 0, 0, 0, 1, 0, 0,
416 0, 0, 0, 0, 1, 0,
417 0, 0, 0, 0, 0, heading_variance
418 };
419 // clang-format on
420
421 std::array<double, 36> new_cov = tf2::transformCovariance(
422 input_covariance,
423 // Per the usage of transformCovariance in tf2_geometry_msgs
424 // this frame should be the transform between the map which the pose
425 // is in an the target frame.
426 T_m_n_no_heading);
427
428 // Populate message
429 geometry_msgs::msg::PoseWithCovariance pose;
430 pose.pose.position.x = T_m_s.getOrigin().getX();
431 pose.pose.position.y = T_m_s.getOrigin().getY();
432 pose.pose.position.z = T_m_s.getOrigin().getZ();
433
434 pose.pose.orientation.x = T_m_s.getRotation().getX();
435 pose.pose.orientation.y = T_m_s.getRotation().getY();
436 pose.pose.orientation.z = T_m_s.getRotation().getZ();
437 pose.pose.orientation.w = T_m_s.getRotation().getW();
438
439 pose.covariance = new_cov;
440
441 return pose;
442}
geometry_msgs::msg::PoseWithCovariance::_covariance_type transformCovariance(const geometry_msgs::msg::PoseWithCovariance::_covariance_type &cov_in, const tf2::Transform &transform)
Transform the covariance matrix of a PoseWithCovariance message to a new frame.

References covariance_helper::transformCovariance().

Referenced by motion_computation::conversion::convert().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ predicted_poses_to_predicted_state()

std::vector< carma_perception_msgs::msg::PredictedState > motion_computation::conversion::impl::predicted_poses_to_predicted_state ( const std::vector< geometry_msgs::msg::Pose > &  poses,
double  constant_velocity,
const rclcpp::Time &  start_time,
const rclcpp::Duration &  step_size,
const std::string &  frame,
double  initial_pose_confidence,
double  initial_vel_confidence 
)

Definition at line 444 of file psm_to_external_object_convertor.cpp.

448{
449 std::vector<carma_perception_msgs::msg::PredictedState> output;
450 output.reserve(poses.size());
451
452 rclcpp::Time time(start_time);
453
454 for (auto p : poses) {
455 time += step_size;
456 carma_perception_msgs::msg::PredictedState pred_state;
457 pred_state.header.stamp = time;
458 pred_state.header.frame_id = frame;
459
460 pred_state.predicted_position = p;
461 pred_state.predicted_position_confidence =
462 0.9 * initial_pose_confidence; // Reduce confidence by 10 % per timestep
463 initial_pose_confidence = pred_state.predicted_position_confidence;
464
465 pred_state.predicted_velocity.linear.x = constant_velocity;
466 pred_state.predicted_velocity_confidence =
467 0.9 * initial_vel_confidence; // Reduce confidence by
468 // 10 % per timestep
469 initial_vel_confidence = pred_state.predicted_velocity_confidence;
470
471 output.push_back(pred_state);
472 }
473
474 return output;
475}

Referenced by motion_computation::conversion::convert().

Here is the caller graph for this function:

◆ sample_2d_linear_motion()

std::vector< geometry_msgs::msg::Pose > motion_computation::conversion::impl::sample_2d_linear_motion ( const geometry_msgs::msg::Pose &  pose,
double  velocity,
double  period,
double  step_size 
)

Definition at line 294 of file psm_to_external_object_convertor.cpp.

296{
297 std::vector<geometry_msgs::msg::Pose> output;
298 output.reserve((period / step_size) + 1);
299
300 tf2::Vector3 pose_in_map_translation(pose.position.x, pose.position.y, pose.position.z);
301 tf2::Quaternion pose_in_map_quat(
302 pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w);
303
304 tf2::Transform pose_in_map(pose_in_map_quat, pose_in_map_translation);
305
306 double total_dt = 0;
307
308 while (total_dt < period) {
309 // Compute the 2d position and orientation in the Pose frame
310 total_dt += step_size;
311 double dx_from_start = velocity * total_dt; // Assuming linear motion in pose frame
312
313 double x = pose.position.x + dx_from_start;
314
315 tf2::Vector3 position(x, 0, 0);
316
317 // Convert the position and orientation in the pose frame to the map frame
318 tf2::Transform pose_to_sample(tf2::Quaternion::getIdentity(), position);
319 tf2::Transform map_to_sample = pose_in_map * pose_to_sample;
320
321 geometry_msgs::msg::Pose sample_pose;
322
323 sample_pose.position.x = map_to_sample.getOrigin().x();
324 sample_pose.position.y = map_to_sample.getOrigin().y();
325 sample_pose.position.z = map_to_sample.getOrigin().z();
326
327 sample_pose.orientation.x = map_to_sample.getRotation().x();
328 sample_pose.orientation.y = map_to_sample.getRotation().y();
329 sample_pose.orientation.z = map_to_sample.getRotation().z();
330 sample_pose.orientation.w = map_to_sample.getRotation().w();
331
332 output.emplace_back(sample_pose);
333 }
334
335 return output;
336}

References process_traj_logs::x.

Referenced by motion_computation::conversion::convert().

Here is the caller graph for this function:

◆ sample_2d_path_from_radius()

std::vector< geometry_msgs::msg::Pose > motion_computation::conversion::impl::sample_2d_path_from_radius ( const geometry_msgs::msg::Pose &  pose,
double  velocity,
double  radius_of_curvature,
double  period,
double  step_size 
)

Definition at line 237 of file psm_to_external_object_convertor.cpp.

240{
241 std::vector<geometry_msgs::msg::Pose> output;
242 output.reserve((period / step_size) + 1);
243
244 tf2::Vector3 pose_in_map_translation(pose.position.x, pose.position.y, pose.position.z);
245 tf2::Quaternion pose_in_map_quat(
246 pose.orientation.x, pose.orientation.y, pose.orientation.z, pose.orientation.w);
247 tf2::Transform pose_in_map(pose_in_map_quat, pose_in_map_translation);
248
249 // The radius of curvature originates from the frame of the provided pose
250 // So the turning center is at (0, r)
251 double center_x_in_pose = 0;
252 double center_y_in_pose = radius_of_curvature;
253
254 double total_dt = 0;
255
256 while (total_dt < period) {
257 // Compute the 2d position and orientation in the Pose frame
258 total_dt += step_size;
259 double delta_arc_length = velocity * total_dt; // Assumes perfect point motion along curve
260
261 double turning_angle = delta_arc_length / radius_of_curvature;
262 double dx_from_center = radius_of_curvature * sin(turning_angle);
263 double dy_from_center = radius_of_curvature * cos(turning_angle);
264
265 double x = center_x_in_pose + dx_from_center;
266 double y = center_y_in_pose + dy_from_center;
267
268 tf2::Vector3 position(x, y, 0);
269
270 tf2::Quaternion quat;
271 quat.setRPY(0, 0, turning_angle);
272
273 // Convert the position and orientation in the pose frame to the map frame
274 tf2::Transform pose_to_sample(quat, position);
275 tf2::Transform map_to_sample = pose_in_map * pose_to_sample;
276
277 geometry_msgs::msg::Pose sample_pose;
278
279 sample_pose.position.x = map_to_sample.getOrigin().x();
280 sample_pose.position.y = map_to_sample.getOrigin().y();
281 sample_pose.position.z = pose.orientation.z; // Reuse the z position from the initial pose
282
283 sample_pose.orientation.x = map_to_sample.getRotation().x();
284 sample_pose.orientation.y = map_to_sample.getRotation().y();
285 sample_pose.orientation.z = map_to_sample.getRotation().z();
286 sample_pose.orientation.w = map_to_sample.getRotation().w();
287
288 output.emplace_back(sample_pose);
289 }
290
291 return output;
292}

References process_traj_logs::x, and process_traj_logs::y.

Referenced by motion_computation::conversion::convert().

Here is the caller graph for this function:

◆ transform_to_map_frame()

tf2::Vector3 motion_computation::conversion::impl::transform_to_map_frame ( const tf2::Vector3 &  ecef_point,
const lanelet::projection::LocalFrameProjector &  map_projector 
)

Transforms ecef point to map frame using internally saved map transform.

Parameters
ecef_pointecef_point to transform
map_projectorProjector used for frame conversion
Returns
point in map

Definition at line 254 of file mobility_path_to_external_object.cpp.

256{
257 lanelet::BasicPoint3d map_point = map_projector.projectECEF(
258 {ecef_point.x(), ecef_point.y(), ecef_point.z()},
259 -1); // Input should already be converted to m
260
261 return tf2::Vector3(map_point.x(), map_point.y(), map_point.z());
262}

Referenced by motion_computation::conversion::convert().

Here is the caller graph for this function: