18 #ifndef VRX_GAZEBO_NAVIGATION_SCORING_PLUGIN_HH_ 19 #define VRX_GAZEBO_NAVIGATION_SCORING_PLUGIN_HH_ 23 #include <gazebo/common/Events.hh> 24 #include <gazebo/physics/Model.hh> 25 #include <gazebo/physics/World.hh> 26 #include <ignition/math/Pose3.hh> 114 public:
Gate(
const gazebo::physics::LinkPtr _leftMarkerModel,
115 const gazebo::physics::LinkPtr _rightMarkerModel);
121 const ignition::math::Pose3d &_robotWorldPose)
const;
135 public: ignition::math::Pose3d
pose;
148 public:
void Load(gazebo::physics::WorldPtr _world,
149 sdf::ElementPtr _sdf);
154 private:
bool ParseGates(sdf::ElementPtr _sdf);
160 private:
bool AddGate(
const std::string &_leftMarkerName,
161 const std::string &_rightMarkerName);
167 private:
void Fail();
173 private: gazebo::physics::ModelPtr
course;
std::vector< Gate > gates
All the gates.
gazebo::physics::LinkPtr rightMarkerModel
The right marker model.
Gate invalid. E.g.: if crossed in the wrong direction.
double width
The width of the gate in meters.
GateState
All gate states.
ignition::math::Pose3d pose
The center of the gate in the world frame. Note that the roll and pitch are ignored. Only yaw is relevant and it points into the direction in which the gate should be crossed.
gazebo::physics::LinkPtr leftMarkerModel
The left marker model.
gazebo::physics::ModelPtr course
bool ParseGates(sdf::ElementPtr _sdf)
Parse the gates from SDF.
void Load(gazebo::physics::WorldPtr _world, sdf::ElementPtr _sdf)
int numGates
Number of gates.
A plugin that provides common functionality to any scoring plugin. This plugin defines four different...
void Fail()
Set the score to 0 and change to state to "finish".
unsigned int numCollisions
The number of WAM-V collisions.
double obstaclePenalty
Number of points deducted per collision.
bool AddGate(const std::string &_leftMarkerName, const std::string &_rightMarkerName)
Register a new gate.
void OnCollision() override
Callback executed when a collision is detected for the WAMV.
void Update()
Callback executed at every world update.
A gate that is part of the navigation challenge.
NavigationScoringPlugin()
gazebo::event::ConnectionPtr updateConnection
Pointer to the update event connection.
A plugin for computing the score of the navigation task. This plugin derives from the generic Scoring...