SMORES Robot Platform Simulation
Modlab at Penn, ASL at Cornell
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends
SmoresModule.hh
1 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 // Author: Edward Yunkai Cui
3 // Description: This class is built for configuration representation.
4 // This class combines with 'SmoresEdge' and 'SmoresNode'
5 // can represent very complicated graph structure.
6 // A module has four nodes, and there geometry relations
7 // are predetermined. This class provides some utility
8 // functions to access the nodes and edges in the configuration
9 // easily.
10 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11 #ifndef _GAZEBO_SMORES_MODULE_HH_
12 #define _GAZEBO_SMORES_MODULE_HH_
13 #include <string>
15 #include <iostream>
16 
17 #include "SmoresEdge.hh"
18 #include "SmoresNode.hh"
19 #include "CommandManagement.hh"
20 
21 namespace gazebo{
23 typedef boost::shared_ptr<ModuleCommands> ModuleCommandsPtr;
25 
30 {
31  public:
33 
41  SmoresModule(string mID, bool mtype, physics::ModelPtr modulePtr,
42  transport::PublisherPtr publisher, transport::SubscriberPtr subsciber,
43  unsigned int num_ID);
45 
52  SmoresModule(string mID, bool mtype, physics::ModelPtr modulePtr,
53  transport::PublisherPtr publisher, transport::SubscriberPtr subsciber);
55 
62  SmoresModule(string mID, bool mtype, transport::PublisherPtr publisher,
63  transport::SubscriberPtr subsciber, unsigned int num_ID);
65  ~SmoresModule();
67 
70  void ManuallyNodeInitial(SmoresModulePtr module_ptr);
72 
80  SmoresNodePtr GetNode(int node_id);
82 
86  int GetNodeAxis(int node_id);
88 
91  void SetModulePtr(physics::ModelPtr modelPtr);
93 
97  physics::LinkPtr GetLinkPtr(int node_id);
99  string ModuleID;
101  unsigned int ModuleNumID;
105  physics::ModelPtr ModuleObject;
107  transport::PublisherPtr ModulePublisher;
109  transport::SubscriberPtr ModuleSubscriber;
111  ModuleCommandsPtr moduleCommandContainer;
113  // TODO: Need to add geometry information
114  math::Pose ModulePosition;
116  SmoresNode NodeUH; // The U-shape part
118  SmoresNode NodeFW; // The Front Wheel
131 }; // class SmoresModule
132 } // namespace gazebo
133 #endif
string ModuleID
Unique name for the current module.
Definition: SmoresModule.hh:99
boost::shared_ptr< ModuleCommands > ModuleCommandsPtr
Smart pointer to the ModuleCommands object.
Definition: SmoresModule.hh:23
gazebo name space
Definition: system_gui.cc:41
SmoresNode NodeLW
Node of the left wheel [redundant].
Definition: SmoresModule.hh:120
SmoresNode NodeFW
Node of the front wheel [redundant].
Definition: SmoresModule.hh:118
A class used to store a cluster of nodes which has rigid connectivity.
Definition: SmoresModule.hh:29
void ManuallyNodeInitial(SmoresModulePtr module_ptr)
Manually pass the pointer to the current object to its nodes.
Definition: SmoresModule.cc:49
physics::ModelPtr ModuleObject
A pointer of the gazebo model object for fast access.
Definition: SmoresModule.hh:105
physics::LinkPtr GetLinkPtr(int node_id)
Get the pointer to the gazebo Link object.
Definition: SmoresModule.cc:76
transport::SubscriberPtr ModuleSubscriber
Pointer to the command subscriber.
Definition: SmoresModule.hh:109
bool ModuleType
Active module or Passive Module, true for active.
Definition: SmoresModule.hh:103
math::Pose ModulePosition
Position of the current module [Not implemented].
Definition: SmoresModule.hh:114
A class used to manage each node, in this case is the part has connectable face.
Definition: SmoresNode.hh:17
~SmoresModule()
Destructor.
Definition: SmoresModule.cc:39
SmoresNodePtr NodeUHPtr
Smart pointer of the node of the part that has the square face.
Definition: SmoresModule.hh:124
SmoresNode NodeUH
Node of the part that has the square face [redundant].
Definition: SmoresModule.hh:116
unsigned int ModuleNumID
Position in the vector.
Definition: SmoresModule.hh:101
SmoresNodePtr NodeLWPtr
Smart pointer of the node of the left wheel.
Definition: SmoresModule.hh:128
int GetNodeAxis(int node_id)
Get node axis id, the axis is perpendicular to the connected face.
Definition: SmoresModule.cc:68
boost::shared_ptr< SmoresModule > SmoresModulePtr
Smart pointer of the SmoresModule object.
Definition: CommandManagement.hh:19
transport::PublisherPtr ModulePublisher
Pointer to the command publisher.
Definition: SmoresModule.hh:107
SmoresNode NodeRW
Node of the right wheel [redundant].
Definition: SmoresModule.hh:122
SmoresModule(string mID, bool mtype, physics::ModelPtr modulePtr, transport::PublisherPtr publisher, transport::SubscriberPtr subsciber, unsigned int num_ID)
Constructor.
Definition: SmoresModule.cc:4
SmoresNodePtr GetNode(int node_id)
Get the pointer to the node by node ID.
Definition: SmoresModule.cc:56
boost::shared_ptr< SmoresNode > SmoresNodePtr
Smart pointer of SmoresNode object.
Definition: SmoresEdge.hh:19
SmoresNodePtr NodeFWPtr
Smart pointer of the node of the front wheel.
Definition: SmoresModule.hh:126
ModuleCommandsPtr moduleCommandContainer
Poointer to the command management object of current module.
Definition: SmoresModule.hh:111
SmoresNodePtr NodeRWPtr
Smart pointer of the node of the right wheel.
Definition: SmoresModule.hh:130
void SetModulePtr(physics::ModelPtr modelPtr)
Pass the pointer to the gazebo model object to current object.
Definition: SmoresModule.cc:72