6 #ifndef LIB_ALMATH_SCENEGRAPH_URDF_H
7 #define LIB_ALMATH_SCENEGRAPH_URDF_H
13 #include <boost/property_tree/ptree_fwd.hpp>
14 #include <boost/optional.hpp>
15 #include <boost/function/function_fwd.hpp>
16 #include <boost/ref.hpp>
17 #include <boost/multi_index_container.hpp>
18 #include <boost/multi_index/ordered_index.hpp>
19 #include <boost/multi_index/identity.hpp>
20 #include <boost/multi_index/mem_fun.hpp>
21 #include <boost/multi_index/global_fun.hpp>
22 #include <boost/multi_index/sequenced_index.hpp>
26 #include <boost/property_tree/stream_translator.hpp>
29 namespace property_tree {
35 template <
typename Ch,
typename Traits>
36 struct customize_stream<Ch, Traits, double, void> {
37 static void insert(std::basic_ostream<Ch, Traits> &s,
const double &e) {
38 s.precision(std::numeric_limits<double>::max_digits10);
41 static void extract(std::basic_istream<Ch, Traits> &s,
double &e) {
64 return (a[0] == 0) && (a[1] == 0) && (a[2] == 0);
129 const ptree &
joint(
const std::string &name)
const;
241 std::unique_ptr<detail::UrdfTreeP> _p;
263 const Array3d &xyz()
const {
return _xyz; }
264 const Array3d &rpy()
const {
return _rpy; }
265 Pose inverse()
const;
270 boost::optional<ptree>
to_ptree()
const;
278 return (lhs.xyz() == rhs.xyz()) && (lhs.rpy() == rhs.rpy());
281 return !(lhs == rhs);
294 std::string
name()
const;
322 std::string
name()
const;
323 boost::optional<Inertial>
inertial()
const;
void makeJointFloating(UrdfTree &parser, const std::string &name)
boost::optional< ptree > to_ptree() const
std::string internal_type
std::string parent_link(const ptree &pt)
std::string child_link(const ptree &pt)
void squashJointMass(UrdfTree &parser, const std::string &name)
const ptree & link(const std::string &name) const
boost::optional< internal_type > put_value(const external_type &v)
bool operator==(const Pose &lhs, const Pose &rhs)
void finish(const ptree &joint)
const ptree & joint(const std::string &name) const
std::array< double, 3 > Array3d
bool is_identity(const Pose &p)
void define_as_root_link(const std::string &name)
bool discover(const ptree &joint)
friend Pose operator*(const Pose &lhs, const Pose &rhs)
Inertial(const ptree &pt)
bool operator!=(const Pose &lhs, const Pose &rhs)
void makeJointFixed(UrdfTree &parser, const std::string &name)
std::string name(const ptree &pt)
UrdfTree::JointVisitor JointVisitor
std::string child_link() const
static void extract(std::basic_istream< Ch, Traits > &s, double &e)
std::string parent_link() const
void operator=(UrdfTree const &other)=delete
static void insert(std::basic_ostream< Ch, Traits > &s, const double &e)
virtual bool discover(ptree &)
static Pose from_ptree(const ptree &pt)
std::array< double, 3 > external_type
UrdfDotPrinterVisitor(std::ostream &os)
UrdfTree::JointConstVisitor JointConstVisitor
std::vector< std::string > makeMasslessJointsFixed(UrdfTree &parser)
virtual void finish(const ptree &)
virtual void finish(ptree &)
boost::property_tree::ptree ptree
boost::optional< external_type > get_value(const internal_type &str)
boost::optional< Inertial > inertial() const
std::vector< std::string > makeContinuousJointsFixed(UrdfTree &parser)
void squashFixedJointsMass(UrdfTree &parser)
Pose(const Array3d &xyz, const Array3d &rpy)
void transport_root_link_frame(const Pose &pose)
void traverse_joints(JointConstVisitor &visitor) const
virtual bool discover(const ptree &)
bool is_zero(const Array3d &a)
const std::string & root_link() const