scenario_simulator_v2 C++ API
Functions
helper_functions.hpp File Reference
#include <ament_index_cpp/get_package_share_directory.hpp>
#include <geometry/quaternion/euler_to_quaternion.hpp>
#include <scenario_simulator_exception/exception.hpp>
#include <traffic_simulator/entity/entity_base.hpp>
#include <traffic_simulator/helper/helper.hpp>
#include <traffic_simulator_msgs/msg/entity_subtype.hpp>
#include <traffic_simulator_msgs/msg/entity_type.hpp>
#include "catalogs.hpp"
#include "expect_eq_macros.hpp"
Include dependency graph for helper_functions.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

constexpr auto convertDegToRad (const double deg) -> double
 
constexpr auto convertRadToDeg (const double rad) -> double
 
auto makePoint (const double x, const double y, const double z=0.0) -> geometry_msgs::msg::Point
 
auto makeBoundingBox (const double center_y=0.0) -> traffic_simulator_msgs::msg::BoundingBox
 
auto makeCustom2DBoundingBox (const double x, const double y, const double x_offset=0.0, const double y_offset=0.0) -> traffic_simulator_msgs::msg::BoundingBox
 
auto makeSmallBoundingBox (const double center_y=0.0) -> traffic_simulator_msgs::msg::BoundingBox
 
auto makeQuaternionFromYaw (const double yaw) -> geometry_msgs::msg::Quaternion
 
auto makePose (const double x, const double y, const double yaw_deg) -> geometry_msgs::msg::Pose
 
auto makePose (geometry_msgs::msg::Point position, geometry_msgs::msg::Quaternion orientation=geometry_msgs::msg::Quaternion()) -> geometry_msgs::msg::Pose
 
auto makeHdMapUtilsSharedPointer () -> std::shared_ptr< hdmap_utils::HdMapUtils >
 
auto makeCanonicalizedLaneletPose (std::shared_ptr< hdmap_utils::HdMapUtils > hdmap_utils, const lanelet::Id id=120659, const double s=0.0, const double offset=0.0) -> traffic_simulator::lanelet_pose::CanonicalizedLaneletPose
 
auto makeEntityStatus (std::shared_ptr< hdmap_utils::HdMapUtils > hdmap_utils, traffic_simulator::lanelet_pose::CanonicalizedLaneletPose pose, traffic_simulator_msgs::msg::BoundingBox bbox, const double speed=0.0, const std::string name="default_entity_name", const uint8_t type=traffic_simulator_msgs::msg::EntityType::VEHICLE) -> traffic_simulator::EntityStatus
 
auto makeEntityStatus (std::shared_ptr< hdmap_utils::HdMapUtils >, geometry_msgs::msg::Pose pose, traffic_simulator_msgs::msg::BoundingBox bbox, const double speed=0.0, const std::string name="default_entity_name", const uint8_t type=traffic_simulator_msgs::msg::EntityType::VEHICLE) -> traffic_simulator::EntityStatus
 
auto makeCanonicalizedEntityStatus (std::shared_ptr< hdmap_utils::HdMapUtils > hdmap_utils, traffic_simulator::lanelet_pose::CanonicalizedLaneletPose canonicalized_lanelet_pose, traffic_simulator_msgs::msg::BoundingBox bbox, const double speed=0.0, const std::string name="default_entity_name", const uint8_t type=traffic_simulator_msgs::msg::EntityType::VEHICLE) -> traffic_simulator::entity_status::CanonicalizedEntityStatus
 
auto makeCanonicalizedEntityStatus (std::shared_ptr< hdmap_utils::HdMapUtils > hdmap_utils, geometry_msgs::msg::Pose pose, traffic_simulator_msgs::msg::BoundingBox bbox, const double matching_distance=1.0, const double speed=0.0, const std::string name="default_entity_name", const uint8_t type=traffic_simulator_msgs::msg::EntityType::VEHICLE) -> traffic_simulator::entity_status::CanonicalizedEntityStatus
 

Function Documentation

◆ convertDegToRad()

constexpr auto convertDegToRad ( const double  deg) -> double
constexpr

◆ convertRadToDeg()

constexpr auto convertRadToDeg ( const double  rad) -> double
constexpr

◆ makeBoundingBox()

auto makeBoundingBox ( const double  center_y = 0.0) -> traffic_simulator_msgs::msg::BoundingBox

◆ makeCanonicalizedEntityStatus() [1/2]

auto makeCanonicalizedEntityStatus ( std::shared_ptr< hdmap_utils::HdMapUtils hdmap_utils,
geometry_msgs::msg::Pose  pose,
traffic_simulator_msgs::msg::BoundingBox  bbox,
const double  matching_distance = 1.0,
const double  speed = 0.0,
const std::string  name = "default_entity_name",
const uint8_t  type = traffic_simulator_msgs::msg::EntityType::VEHICLE 
) -> traffic_simulator::entity_status::CanonicalizedEntityStatus

◆ makeCanonicalizedEntityStatus() [2/2]

auto makeCanonicalizedEntityStatus ( std::shared_ptr< hdmap_utils::HdMapUtils hdmap_utils,
traffic_simulator::lanelet_pose::CanonicalizedLaneletPose  canonicalized_lanelet_pose,
traffic_simulator_msgs::msg::BoundingBox  bbox,
const double  speed = 0.0,
const std::string  name = "default_entity_name",
const uint8_t  type = traffic_simulator_msgs::msg::EntityType::VEHICLE 
) -> traffic_simulator::entity_status::CanonicalizedEntityStatus

◆ makeCanonicalizedLaneletPose()

auto makeCanonicalizedLaneletPose ( std::shared_ptr< hdmap_utils::HdMapUtils hdmap_utils,
const lanelet::Id  id = 120659,
const double  s = 0.0,
const double  offset = 0.0 
) -> traffic_simulator::lanelet_pose::CanonicalizedLaneletPose

◆ makeCustom2DBoundingBox()

auto makeCustom2DBoundingBox ( const double  x,
const double  y,
const double  x_offset = 0.0,
const double  y_offset = 0.0 
) -> traffic_simulator_msgs::msg::BoundingBox

◆ makeEntityStatus() [1/2]

auto makeEntityStatus ( std::shared_ptr< hdmap_utils::HdMapUtils hdmap_utils,
traffic_simulator::lanelet_pose::CanonicalizedLaneletPose  pose,
traffic_simulator_msgs::msg::BoundingBox  bbox,
const double  speed = 0.0,
const std::string  name = "default_entity_name",
const uint8_t  type = traffic_simulator_msgs::msg::EntityType::VEHICLE 
) -> traffic_simulator::EntityStatus

◆ makeEntityStatus() [2/2]

auto makeEntityStatus ( std::shared_ptr< hdmap_utils::HdMapUtils ,
geometry_msgs::msg::Pose  pose,
traffic_simulator_msgs::msg::BoundingBox  bbox,
const double  speed = 0.0,
const std::string  name = "default_entity_name",
const uint8_t  type = traffic_simulator_msgs::msg::EntityType::VEHICLE 
) -> traffic_simulator::EntityStatus

◆ makeHdMapUtilsSharedPointer()

auto makeHdMapUtilsSharedPointer ( ) -> std::shared_ptr<hdmap_utils::HdMapUtils>

◆ makePoint()

auto makePoint ( const double  x,
const double  y,
const double  z = 0.0 
) -> geometry_msgs::msg::Point

◆ makePose() [1/2]

auto makePose ( const double  x,
const double  y,
const double  yaw_deg 
) -> geometry_msgs::msg::Pose
Note
+x axis is 0 degrees; +y axis is 90 degrees

◆ makePose() [2/2]

auto makePose ( geometry_msgs::msg::Point  position,
geometry_msgs::msg::Quaternion  orientation = geometry_msgs::msg::Quaternion() 
) -> geometry_msgs::msg::Pose

◆ makeQuaternionFromYaw()

auto makeQuaternionFromYaw ( const double  yaw) -> geometry_msgs::msg::Quaternion

◆ makeSmallBoundingBox()

auto makeSmallBoundingBox ( const double  center_y = 0.0) -> traffic_simulator_msgs::msg::BoundingBox