From cb8b64791b70b57c4b49c3ff7f6efabded973091 Mon Sep 17 00:00:00 2001
From: Gabriele Buondonno <gbuondon@laas.fr>
Date: Fri, 25 Oct 2019 15:44:54 +0200
Subject: [PATCH] [python] Fix Box bindings

---
 python/collision-geometries.cc | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/python/collision-geometries.cc b/python/collision-geometries.cc
index 230cb7b1..7a57def1 100644
--- a/python/collision-geometries.cc
+++ b/python/collision-geometries.cc
@@ -103,6 +103,17 @@ struct ConvexWrapper
   }
 };
 
+Eigen::Vector3d getHalfSide(const ::hpp::fcl::Box & box)
+{
+  Eigen::Vector3d halfSide = box.halfSide;
+  return halfSide;
+}
+
+void setHalfSide(::hpp::fcl::Box & box, const Eigen::Vector3d & halfSide)
+{
+  box.halfSide = halfSide;
+}
+
 void exposeShapes ()
 {
   class_ <ShapeBase, bases<CollisionGeometry>, shared_ptr<ShapeBase>, noncopyable>
@@ -114,7 +125,7 @@ void exposeShapes ()
     ("Box", init<>())
     .def (init<FCL_REAL,FCL_REAL,FCL_REAL>())
     .def (init<Vec3f>())
-    .def_readwrite ("halfSide", &Box::halfSide)
+    .add_property("halfSide", make_function(getHalfSide), make_function(setHalfSide))
     ;
 
   class_ <Capsule, bases<ShapeBase>, shared_ptr<Capsule> >
-- 
GitLab