Skip to content

Commit

Permalink
include sensors into the model
Browse files Browse the repository at this point in the history
  • Loading branch information
rhaschke committed Mar 8, 2016
1 parent dd546d9 commit f9995d3
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
15 changes: 14 additions & 1 deletion urdf_model/include/urdf_model/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ class ModelInterface
ptr = this->materials_.find(name)->second;
return ptr;
};

/// non-const getSensor()
SensorSharedPtr getSensor(const std::string& name) const
{
SensorSharedPtr ptr;
if (this->sensors_.find(name) == this->sensors_.end())
ptr.reset();
else
ptr = this->sensors_.find(name)->second;
return ptr;
};


void initTree(std::map<std::string, std::string> &parent_link_tree)
{
Expand Down Expand Up @@ -197,7 +209,8 @@ class ModelInterface
/// \brief The root is always a link (the parent of the tree describing the robot)
LinkSharedPtr root_link_;


/// \brief complete list of Sensors
std::map<std::string, SensorSharedPtr> sensors_;

};

Expand Down
1 change: 1 addition & 0 deletions urdf_model/include/urdf_model/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ URDF_TYPEDEF_CLASS_POINTER(JointMimic);
URDF_TYPEDEF_CLASS_POINTER(JointSafety);
URDF_TYPEDEF_CLASS_POINTER(Link);
URDF_TYPEDEF_CLASS_POINTER(Material);
URDF_TYPEDEF_CLASS_POINTER(Sensor);
URDF_TYPEDEF_CLASS_POINTER(Mesh);
URDF_TYPEDEF_CLASS_POINTER(Sphere);
URDF_TYPEDEF_CLASS_POINTER(Visual);
Expand Down

0 comments on commit f9995d3

Please sign in to comment.