23 #ifndef VRX_GAZEBO_PERCEPTION_SCORING_PLUGIN_HH_ 24 #define VRX_GAZEBO_PERCEPTION_SCORING_PLUGIN_HH_ 26 #include <geographic_msgs/GeoPoseStamped.h> 31 #include <gazebo/physics/PhysicsTypes.hh> 32 #include <gazebo/physics/World.hh> 33 #include <gazebo/transport/transport.hh> 70 const double& _duration,
71 const std::string& _type,
72 const std::string& _name,
73 const ignition::math::Pose3d& _trialPose,
74 const gazebo::physics::WorldPtr _world);
78 public:
void SetError(
const double& _error);
82 public:
void StartTrial(
const gazebo::physics::EntityPtr& _frame);
88 public: std::string
Str();
159 public:
virtual void Load(gazebo::physics::WorldPtr _world,
160 sdf::ElementPtr _sdf);
163 protected:
void OnUpdate();
165 private:
void OnAttempt(
166 const geographic_msgs::GeoPoseStamped::ConstPtr &_msg);
169 private:
void Restart();
172 private:
void OnRunning()
override;
175 private:
void ReleaseVehicle()
override;
177 private:
int attemptBal = 0;
180 private: std::string
ns;
192 public: gazebo::physics::WorldPtr
world;
195 public: sdf::ElementPtr
sdf;
198 public: std::vector<PerceptionObject>
objects;
208 public:
bool loopForever =
false;
212 public: std::string frameName = std::string();
215 public: gazebo::physics::EntityPtr
frame;
221 private:
int objectsDespawned =0;
std::string name
PerceptionObject type.
std::string ns
ROS namespace.
ros::Subscriber objectSub
ROS subscriber.
std::string type
PerceptionObject type.
void SetError(const double &_error)
set the error of this boject if this object is active and this is the lowest seen error ...
A plugin that allows models to be spawned at a given location in a specific simulation time and then ...
gazebo::physics::EntityPtr frame
Link/model that the object poses use as their frame of reference.
double duration
amount of time in which the object should be spawned.
sdf::ElementPtr sdf
SDF pointer.
gazebo::event::ConnectionPtr connection
Connection event.
gazebo::common::Time lastUpdateTime
Last time (sim time) that the plugin was updated.
A plugin that provides common functionality to any scoring plugin. This plugin defines four different...
void EndTrial()
move the object back to its original location and make inactive
Class to store information about each object to be populated.
gazebo::common::Time startTime
The time specified in the object is relative to this time.
double error
error associated with the guess of a moel
void StartTrial(const gazebo::physics::EntityPtr &_frame)
move the object to where it is supposed to be relative to the frame
ignition::math::Pose3d trialPose
Pose in which the object should be placed in wam-v's frame.
std::vector< PerceptionObject > objects
Collection of objects to be spawned.
double time
Simulation time in which the object should be spawned.
gazebo::physics::EntityPtr modelPtr
ModelPtr to the model that this object is representing.
PerceptionObject(const double &_time, const double &_duration, const std::string &_type, const std::string &_name, const ignition::math::Pose3d &_trialPose, const gazebo::physics::WorldPtr _world)
constructor of perception object
ros::NodeHandle nh
ROS Node handle.
ignition::math::Pose3d origPose
Pose in which the object should be placed in global frame.
gazebo::physics::WorldPtr world
World pointer.
std::string objectTopic
ROS topic where the object id/pose is received.
bool active
bool to tell weather or not the object is open for attempts