forked from dusty-nv/jetson-reinforcement
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PropPlugin.h
92 lines (70 loc) · 1.6 KB
/
PropPlugin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/*
* http://github.com/dusty-nv/jetson-reinforcement
*/
#ifndef __GAZEBO_PROP_PLUGIN_H__
#define __GAZEBO_PROP_PLUGIN_H__
#include <boost/bind.hpp>
#include <gazebo/gazebo.hh>
#include <gazebo/transport/transport.hh>
#include <gazebo/msgs/msgs.hh>
#include <gazebo/physics/physics.hh>
#include <gazebo/common/common.hh>
#include <stdio.h>
#include <iostream>
#include <gazebo/transport/TransportTypes.hh>
#include <gazebo/msgs/MessageTypes.hh>
#include <gazebo/common/Time.hh>
#include <errno.h>
#include <fcntl.h>
#include <assert.h>
#include <unistd.h>
#include <pthread.h>
#include <ctype.h>
#include <stdbool.h>
#include <math.h>
#include <inttypes.h>
#include <string.h>
#include <syslog.h>
#include <time.h>
namespace gazebo
{
/**
* PropPlugin
*/
class PropPlugin : public ModelPlugin
{
public:
virtual void Load(physics::ModelPtr _parent, sdf::ElementPtr /*_sdf*/);
virtual void OnUpdate(const common::UpdateInfo & /*_info*/);
void UpdateResetPose();
void ResetDynamics();
void Randomize();
physics::ModelPtr model; // Pointer to the model
private:
// Original pose the prop was created in
math::Pose originalPose;
// Pointer to the update event connection
event::ConnectionPtr updateConnection;
};
/**
* Retrieve the number of global Prop objects
*/
size_t GetNumProps();
/**
* Retrieve a global Prop object by index
*/
PropPlugin* GetProp( size_t index );
/**
* Retrieve a global Prop object by name
*/
PropPlugin* GetPropByName( const char* name );
/**
* Reset all prop poses and dynamics
*/
void ResetPropDynamics();
/**
* Randomize prop locations
*/
void RandomizeProps();
}
#endif