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.
WMTestLibForGuidance.hpp File Reference
#include <gtest/gtest.h>
#include <iostream>
#include <carma_wm/CARMAWorldModel.hpp>
#include <lanelet2_core/geometry/LineString.h>
#include <lanelet2_traffic_rules/TrafficRulesFactory.h>
#include <lanelet2_core/Attribute.h>
#include <carma_perception_msgs/msg/roadway_obstacle.hpp>
#include <carma_perception_msgs/msg/predicted_state.hpp>
#include <carma_perception_msgs/msg/connected_vehicle_type.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <tf2/LinearMath/Transform.h>
#include <lanelet2_core/geometry/Polygon.h>
#include <lanelet2_extension/regulatory_elements/DigitalSpeedLimit.h>
#include <carma_wm/Geometry.hpp>
#include <carma_wm/MapConformer.hpp>
#include <rclcpp/rclcpp.hpp>
#include <lanelet2_extension/regulatory_elements/CarmaTrafficSignal.h>
Include dependency graph for WMTestLibForGuidance.hpp:

Go to the source code of this file.

Classes

struct  carma_wm::test::MapOptions
 

Namespaces

namespace  carma_wm
 
namespace  carma_wm::test
 

Functions

lanelet::Point3d carma_wm::test::getPoint (double x, double y, double z)
 helper function for quickly creating a lanelet::Point3d. random id is assigned More...
 
lanelet::BasicPoint2d carma_wm::test::getBasicPoint (double x, double y)
 helper function for quickly creating a lanelet::BasicPoint. random id is assigned More...
 
lanelet::Lanelet carma_wm::test::getLanelet (lanelet::LineString3d &left_ls, lanelet::LineString3d &right_ls, const lanelet::Attribute &left_sub_type=lanelet::AttributeValueString::SolidSolid, const lanelet::Attribute &right_sub_type=lanelet::AttributeValueString::Solid)
 helper function for quickly creating a lanelet::Lanelet using linestrings. random id is assigned More...
 
lanelet::Lanelet carma_wm::test::getLanelet (std::vector< lanelet::Point3d > left, std::vector< lanelet::Point3d > right, const lanelet::Attribute &left_sub_type=lanelet::AttributeValueString::SolidSolid, const lanelet::Attribute &right_sub_type=lanelet::AttributeValueString::Solid)
 helper function for quickly creating a lanelet::Lanelet using points. random id is assigned More...
 
lanelet::Lanelet carma_wm::test::getLanelet (lanelet::Id id, lanelet::LineString3d left_ls, lanelet::LineString3d right_ls, const lanelet::Attribute &left_sub_type=lanelet::AttributeValueString::SolidSolid, const lanelet::Attribute &right_sub_type=lanelet::AttributeValueString::Solid)
 helper function for quickly creating a lanelet::Lanelet using linestrings. id is specified More...
 
lanelet::Lanelet carma_wm::test::getLanelet (lanelet::Id id, std::vector< lanelet::Point3d > left, std::vector< lanelet::Point3d > right, const lanelet::Attribute &left_sub_type=lanelet::AttributeValueString::SolidSolid, const lanelet::Attribute &right_sub_type=lanelet::AttributeValueString::Solid)
 helper function for quickly creating a lanelet::Lanelet using points. id is specified More...
 
lanelet::LaneletMapPtr carma_wm::test::buildGuidanceTestMap (double width, double length, int num=1)
 helper function for creating lanelet map for getGuidanceTestMap More...
 
void carma_wm::test::addObstacle (double x, double y, std::shared_ptr< carma_wm::CARMAWorldModel > cmw, std::vector< std::pair< double, double > > pred_coords={}, int time_step=100, double width=3, double length=3)
 adds a roadway object at the specified cartesian coords More...
 
void carma_wm::test::addObstacle (carma_wm::TrackPos tp, lanelet::Id lanelet_id, std::shared_ptr< carma_wm::CARMAWorldModel > cmw, std::vector< carma_wm::TrackPos > pred_trackpos_list={}, int time_step=100, double width=3, double length=3)
 adds a roadway object at the specified trackpos relative to the given lanelet id More...
 
void carma_wm::test::setSpeedLimit (lanelet::Velocity speed_limit, std::shared_ptr< carma_wm::CARMAWorldModel > cmw)
 Sets all lanelets in the map the given speed limit. More...
 
void carma_wm::test::setRouteByLanelets (std::vector< lanelet::ConstLanelet > lanelets, std::shared_ptr< carma_wm::CARMAWorldModel > cmw)
 Sets the route by series of lanelets. More...
 
void carma_wm::test::setRouteByIds (std::vector< lanelet::Id > lanelet_ids, std::shared_ptr< carma_wm::CARMAWorldModel > cmw)
 Sets the route by series of lanelets id. More...
 
void carma_wm::test::addTrafficLight (std::shared_ptr< carma_wm::CARMAWorldModel > cmw, lanelet::Id light_id, std::vector< lanelet::Id > entry_lanelet_ids, std::vector< lanelet::Id > exit_lanelet_ids, std::vector< std::pair< boost::posix_time::ptime, lanelet::CarmaTrafficSignalState > > timing_plan={ std::make_pair< boost::posix_time::ptime, lanelet::CarmaTrafficSignalState >(lanelet::time::timeFromSec(0), lanelet::CarmaTrafficSignalState::PROTECTED_MOVEMENT_ALLOWED), std::make_pair< boost::posix_time::ptime, lanelet::CarmaTrafficSignalState >(lanelet::time::timeFromSec(4.0), lanelet::CarmaTrafficSignalState::PROTECTED_CLEARANCE), std::make_pair< boost::posix_time::ptime, lanelet::CarmaTrafficSignalState >(lanelet::time::timeFromSec(24.0), lanelet::CarmaTrafficSignalState::STOP_AND_REMAIN), std::make_pair< boost::posix_time::ptime, lanelet::CarmaTrafficSignalState >(lanelet::time::timeFromSec(44.0), lanelet::CarmaTrafficSignalState::PROTECTED_MOVEMENT_ALLOWED) })
 Method adds a traffic light to the provided world model instance NOTE: The stop line for the light will be located at the end of the owning_lanelets (in order) and formed from their two bound end points. NOTE: Exit lanelet matches the entry lanelets by order.
More...
 
std::shared_ptr< carma_wm::CARMAWorldModelcarma_wm::test::getGuidanceTestMap (MapOptions map_options)
 Gets the CARMAWorldModel for the guidance test map. More...
 
std::shared_ptr< carma_wm::CARMAWorldModelcarma_wm::test::getGuidanceTestMap ()