scenario_simulator_v2 C++ API
Classes | Public Member Functions | Public Attributes | List of all members
traffic_simulator::entity::PedestrianEntity Class Reference

#include <pedestrian_entity.hpp>

Inheritance diagram for traffic_simulator::entity::PedestrianEntity:
Inheritance graph
[legend]
Collaboration diagram for traffic_simulator::entity::PedestrianEntity:
Collaboration graph
[legend]

Classes

struct  BuiltinBehavior
 

Public Member Functions

 PedestrianEntity (const std::string &name, const CanonicalizedEntityStatus &, const std::shared_ptr< hdmap_utils::HdMapUtils > &, const traffic_simulator_msgs::msg::PedestrianParameters &, const std::string &plugin_name=BuiltinBehavior::defaultBehavior())
 
 ~PedestrianEntity () override=default
 
void appendDebugMarker (visualization_msgs::msg::MarkerArray &marker_array) override
 
auto getEntityTypename () const -> const std::string &override
 
auto onUpdate (const double current_time, const double step_time) -> void override
 
void requestAcquirePosition (const CanonicalizedLaneletPose &lanelet_pose) override
 
void requestAcquirePosition (const geometry_msgs::msg::Pose &map_pose) override
 
void requestWalkStraight () override
 
void cancelRequest () override
 
void setTrafficLights (const std::shared_ptr< traffic_simulator::TrafficLightsBase > &ptr) override
 
auto getBehaviorParameter () const -> traffic_simulator_msgs::msg::BehaviorParameter
 
auto getMaxAcceleration () const -> double override
 
auto getMaxDeceleration () const -> double override
 
void setBehaviorParameter (const traffic_simulator_msgs::msg::BehaviorParameter &)
 
void setVelocityLimit (double linear_velocity) override
 
void setAccelerationLimit (double acceleration) override
 
void setAccelerationRateLimit (double acceleration_rate) override
 
void setDecelerationLimit (double deceleration) override
 
void setDecelerationRateLimit (double deceleration) override
 
void requestAssignRoute (const std::vector< CanonicalizedLaneletPose > &waypoints) override
 
void requestAssignRoute (const std::vector< geometry_msgs::msg::Pose > &) override
 
auto requestFollowTrajectory (const std::shared_ptr< traffic_simulator_msgs::msg::PolylineTrajectory > &) -> void override
 
std::string getCurrentAction () const override
 
auto getDefaultDynamicConstraints () const -> const traffic_simulator_msgs::msg::DynamicConstraints &override
 
auto getRouteLanelets (double horizon=100) -> lanelet::Ids override
 
auto getObstacle () -> std::optional< traffic_simulator_msgs::msg::Obstacle > override
 
auto getGoalPoses () -> std::vector< CanonicalizedLaneletPose > override
 
auto getWaypoints () -> const traffic_simulator_msgs::msg::WaypointsArray override
 
- Public Member Functions inherited from traffic_simulator::entity::EntityBase
 EntityBase (const std::string &name, const CanonicalizedEntityStatus &entity_status, const std::shared_ptr< hdmap_utils::HdMapUtils > &hdmap_utils_ptr)
 
virtual ~EntityBase ()=default
 
virtual auto asFieldOperatorApplication () const -> concealer::FieldOperatorApplication &
 
auto getBoundingBox () const noexcept -> const traffic_simulator_msgs::msg::BoundingBox &
 Get BoundingBox of the entity. More...
 
auto getCanonicalizedStatus () const noexcept -> const CanonicalizedEntityStatus &
 Get CanonicalizedStatus of the entity. More...
 
auto getCanonicalizedStatusBeforeUpdate () const noexcept -> const CanonicalizedEntityStatus &
 Get CanonicalizedStatusBeforeUpdate of the entity. More...
 
auto getCurrentAccel () const noexcept -> const geometry_msgs::msg::Accel &
 Get CurrentAccel of the entity. More...
 
auto getCurrentTwist () const noexcept -> const geometry_msgs::msg::Twist &
 Get CurrentTwist of the entity. More...
 
auto getDynamicConstraints () const noexcept -> traffic_simulator_msgs::msg::DynamicConstraints
 Get DynamicConstraints of the entity. More...
 
auto getEntitySubtype () const noexcept -> const traffic_simulator_msgs::msg::EntitySubtype &
 Get EntitySubtype of the entity. More...
 
auto getEntityType () const noexcept -> const traffic_simulator_msgs::msg::EntityType &
 Get EntityType of the entity. More...
 
auto getLinearJerk () const noexcept -> double
 Get LinearJerk of the entity. More...
 
auto getMapPose () const noexcept -> const geometry_msgs::msg::Pose &
 Get MapPose of the entity. More...
 
auto getStandStillDuration () const noexcept -> double
 Get StandStillDuration of the entity. More...
 
auto getTraveledDistance () const noexcept -> double
 Get TraveledDistance of the entity. More...
 
auto laneMatchingSucceed () const -> bool
 
auto get2DPolygon () const -> std::vector< geometry_msgs::msg::Point >
 
auto getCanonicalizedLaneletPose () const -> std::optional< CanonicalizedLaneletPose >
 
auto getCanonicalizedLaneletPose (const double matching_distance) const -> std::optional< CanonicalizedLaneletPose >
 
virtual auto getDefaultMatchingDistanceForLaneletPoseCalculation () const -> double
 
virtual auto onPostUpdate (const double current_time, const double step_time) -> void
 
void resetDynamicConstraints ()
 
virtual void requestLaneChange (const lanelet::Id)
 
virtual void requestLaneChange (const traffic_simulator::lane_change::Parameter &)
 
void requestLaneChange (const lane_change::AbsoluteTarget &target, const lane_change::TrajectoryShape trajectory_shape, const lane_change::Constraint &constraint)
 
void requestLaneChange (const lane_change::RelativeTarget &target, const lane_change::TrajectoryShape trajectory_shape, const lane_change::Constraint &constraint)
 
virtual void requestSpeedChange (const double target_speed, const speed_change::Transition transition, const speed_change::Constraint constraint, const bool continuous)
 
virtual void requestSpeedChange (const speed_change::RelativeTargetSpeed &target_speed, const speed_change::Transition transition, const speed_change::Constraint constraint, const bool continuous)
 
virtual void requestSpeedChange (const double target_speed, const bool continuous)
 
virtual void requestSpeedChange (const speed_change::RelativeTargetSpeed &target_speed, const bool continuous)
 
virtual void requestClearRoute ()
 
virtual auto isControlledBySimulator () const -> bool
 
virtual auto setControlledBySimulator (const bool) -> void
 
void setDynamicConstraints (const traffic_simulator_msgs::msg::DynamicConstraints &constraints)
 
void setOtherStatus (const std::unordered_map< std::string, CanonicalizedEntityStatus > &status)
 
virtual auto setStatus (const EntityStatus &status, const lanelet::Ids &lanelet_ids) -> void
 
virtual auto setStatus (const EntityStatus &status) -> void
 
auto setCanonicalizedStatus (const CanonicalizedEntityStatus &status) -> void
 
virtual auto setLinearAcceleration (const double linear_acceleration) -> void
 
virtual auto setLinearVelocity (const double linear_velocity) -> void
 
virtual auto activateOutOfRangeJob (const double min_velocity, const double max_velocity, const double min_acceleration, const double max_acceleration, const double min_jerk, const double max_jerk) -> void
 
virtual auto setMapPose (const geometry_msgs::msg::Pose &map_pose) -> void
 
auto setTwist (const geometry_msgs::msg::Twist &twist) -> void
 
auto setAcceleration (const geometry_msgs::msg::Accel &accel) -> void
 
auto setAction (const std::string &action) -> void
 
auto setLinearJerk (const double liner_jerk) -> void
 
void stopAtCurrentPosition ()
 
void updateEntityStatusTimestamp (const double current_time)
 
bool reachPosition (const geometry_msgs::msg::Pose &target_pose, const double tolerance) const
 
bool reachPosition (const CanonicalizedLaneletPose &lanelet_pose, const double tolerance) const
 
bool reachPosition (const std::string &target_name, const double tolerance) const
 
auto requestSynchronize (const std::string &target_name, const CanonicalizedLaneletPose &target_sync_pose, const CanonicalizedLaneletPose &entity_target, const double target_speed, const double tolerance) -> bool
 

Public Attributes

const std::string plugin_name
 
const traffic_simulator_msgs::msg::PedestrianParameters pedestrian_parameters
 
- Public Attributes inherited from traffic_simulator::entity::EntityBase
const std::string name
 
bool verbose
 

Additional Inherited Members

- Protected Attributes inherited from traffic_simulator::entity::EntityBase
std::shared_ptr< CanonicalizedEntityStatusstatus_
 
CanonicalizedEntityStatus status_before_update_
 
std::shared_ptr< hdmap_utils::HdMapUtilshdmap_utils_ptr_
 
std::shared_ptr< traffic_simulator::TrafficLightsBasetraffic_lights_
 
double stand_still_duration_ = 0.0
 
double traveled_distance_ = 0.0
 
double prev_job_duration_ = 0.0
 
double step_time_ = 0.0
 
std::unordered_map< std::string, CanonicalizedEntityStatusother_status_
 
std::optional< double > target_speed_
 
traffic_simulator::job::JobList job_list_
 
std::unique_ptr< traffic_simulator::longitudinal_speed_planning::LongitudinalSpeedPlannerspeed_planner_
 

Constructor & Destructor Documentation

◆ PedestrianEntity()

traffic_simulator::entity::PedestrianEntity::PedestrianEntity ( const std::string &  name,
const CanonicalizedEntityStatus entity_status,
const std::shared_ptr< hdmap_utils::HdMapUtils > &  hdmap_utils_ptr,
const traffic_simulator_msgs::msg::PedestrianParameters &  parameters,
const std::string &  plugin_name = BuiltinBehavior::defaultBehavior() 
)
explicit

◆ ~PedestrianEntity()

traffic_simulator::entity::PedestrianEntity::~PedestrianEntity ( )
overridedefault

Member Function Documentation

◆ appendDebugMarker()

void traffic_simulator::entity::PedestrianEntity::appendDebugMarker ( visualization_msgs::msg::MarkerArray &  marker_array)
overridevirtual

◆ cancelRequest()

void traffic_simulator::entity::PedestrianEntity::cancelRequest ( )
overridevirtual

◆ getBehaviorParameter()

auto traffic_simulator::entity::PedestrianEntity::getBehaviorParameter ( ) const -> traffic_simulator_msgs::msg::BehaviorParameter
virtual

◆ getCurrentAction()

std::string traffic_simulator::entity::PedestrianEntity::getCurrentAction ( ) const
overridevirtual

◆ getDefaultDynamicConstraints()

auto traffic_simulator::entity::PedestrianEntity::getDefaultDynamicConstraints ( ) const -> const traffic_simulator_msgs::msg::DynamicConstraints &
overridevirtual

◆ getEntityTypename()

auto traffic_simulator::entity::PedestrianEntity::getEntityTypename ( ) const -> const std::string &
overridevirtual

◆ getGoalPoses()

auto traffic_simulator::entity::PedestrianEntity::getGoalPoses ( ) -> std::vector<CanonicalizedLaneletPose>
overridevirtual

◆ getMaxAcceleration()

auto traffic_simulator::entity::PedestrianEntity::getMaxAcceleration ( ) const -> double
overridevirtual

◆ getMaxDeceleration()

auto traffic_simulator::entity::PedestrianEntity::getMaxDeceleration ( ) const -> double
overridevirtual

◆ getObstacle()

auto traffic_simulator::entity::PedestrianEntity::getObstacle ( ) -> std::optional<traffic_simulator_msgs::msg::Obstacle>
overridevirtual

◆ getRouteLanelets()

auto traffic_simulator::entity::PedestrianEntity::getRouteLanelets ( double  horizon = 100) -> lanelet::Ids
overridevirtual

◆ getWaypoints()

const traffic_simulator_msgs::msg::WaypointsArray traffic_simulator::entity::PedestrianEntity::getWaypoints ( ) -> const traffic_simulator_msgs::msg::WaypointsArray
overridevirtual

◆ onUpdate()

auto traffic_simulator::entity::PedestrianEntity::onUpdate ( const double  current_time,
const double  step_time 
) -> void
overridevirtual
Note
CanonicalizedEntityStatus is updated here, it is not skipped even if isAtEndOfLanelets return true

Reimplemented from traffic_simulator::entity::EntityBase.

◆ requestAcquirePosition() [1/2]

void traffic_simulator::entity::PedestrianEntity::requestAcquirePosition ( const CanonicalizedLaneletPose lanelet_pose)
overridevirtual

◆ requestAcquirePosition() [2/2]

void traffic_simulator::entity::PedestrianEntity::requestAcquirePosition ( const geometry_msgs::msg::Pose &  map_pose)
overridevirtual

◆ requestAssignRoute() [1/2]

void traffic_simulator::entity::PedestrianEntity::requestAssignRoute ( const std::vector< CanonicalizedLaneletPose > &  waypoints)
overridevirtual

◆ requestAssignRoute() [2/2]

void traffic_simulator::entity::PedestrianEntity::requestAssignRoute ( const std::vector< geometry_msgs::msg::Pose > &  waypoints)
overridevirtual

◆ requestFollowTrajectory()

auto traffic_simulator::entity::PedestrianEntity::requestFollowTrajectory ( const std::shared_ptr< traffic_simulator_msgs::msg::PolylineTrajectory > &  parameter) -> void
overridevirtual

◆ requestWalkStraight()

void traffic_simulator::entity::PedestrianEntity::requestWalkStraight ( )
overridevirtual

◆ setAccelerationLimit()

void traffic_simulator::entity::PedestrianEntity::setAccelerationLimit ( double  acceleration)
overridevirtual

◆ setAccelerationRateLimit()

void traffic_simulator::entity::PedestrianEntity::setAccelerationRateLimit ( double  acceleration_rate)
overridevirtual

◆ setBehaviorParameter()

void traffic_simulator::entity::PedestrianEntity::setBehaviorParameter ( const traffic_simulator_msgs::msg::BehaviorParameter &  behavior_parameter)
virtual

◆ setDecelerationLimit()

void traffic_simulator::entity::PedestrianEntity::setDecelerationLimit ( double  deceleration)
overridevirtual

◆ setDecelerationRateLimit()

void traffic_simulator::entity::PedestrianEntity::setDecelerationRateLimit ( double  deceleration)
overridevirtual

◆ setTrafficLights()

void traffic_simulator::entity::PedestrianEntity::setTrafficLights ( const std::shared_ptr< traffic_simulator::TrafficLightsBase > &  ptr)
overridevirtual

◆ setVelocityLimit()

void traffic_simulator::entity::PedestrianEntity::setVelocityLimit ( double  linear_velocity)
overridevirtual

Member Data Documentation

◆ pedestrian_parameters

const traffic_simulator_msgs::msg::PedestrianParameters traffic_simulator::entity::PedestrianEntity::pedestrian_parameters

◆ plugin_name

const std::string traffic_simulator::entity::PedestrianEntity::plugin_name

The documentation for this class was generated from the following files: