hpp-python  6.1.0
python bindings for HPP, based on boost python
device.hh
Go to the documentation of this file.
1 //
2 // Copyright (c) 2025, CNRS
3 // Authors: Florent Lamiraux
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions
7 // are met:
8 
9 // 1. Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer.
11 
12 // 2. Redistributions in binary form must reproduce the above
13 // copyright notice, this list of conditions and the following
14 // disclaimer in the documentation and/or other materials provided
15 // with the distribution.
16 
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21 // COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
22 // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24 // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 // STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28 // OF THE POSSIBILITY OF SUCH DAMAGE.
29 
30 #ifndef PYHPP_MANIPULATION_DEVICE_HH
31 #define PYHPP_MANIPULATION_DEVICE_HH
32 
34 #include <hpp/manipulation/device.hh>
36 #include <hpp/pinocchio/device.hh>
37 #include <hpp/pinocchio/frame.hh>
38 #include <hpp/pinocchio/gripper.hh>
39 #include <hpp/pinocchio/joint.hh>
40 #include <pinocchio/multibody/data.hpp>
41 #include <pinocchio/multibody/geometry.hpp>
42 #include <pinocchio/spatial/se3.hpp>
44 
45 namespace pyhpp {
46 namespace manipulation {
47 
69 
70 // Wrapper class to hpp::manipulation::Device
71 //
72 // Boost python does not correctly handle weak pointers. To overcome this
73 // limitation, we create a wrapper class and bind this class with boost python
74 // instead of the original class.
75 struct Device {
77  Device(const DevicePtr_t& object);
78  Device(const std::string& name);
79  // Methods from hpp::pinocchio::Device
80  const std::string& name() const;
81  const LiegroupSpacePtr_t& configSpace() const;
82  Model& model();
83  Data& data();
84  GeomData& geomData();
87  size_type configSize() const;
88  size_type numberDof() const;
90  bool currentConfiguration(ConfigurationIn_t configuration);
91  void computeForwardKinematics(int flag);
94  // Methods for hpp::manipulation::Device
95  void setRobotRootPosition(const std::string& robotName,
96  const Transform3s& positionWRTParentJoint);
98  boost::python::list getJointConfig(const char* jointName);
99  boost::python::list getJointNames();
100  void setJointBounds(const char* jointName, boost::python::list jointBounds);
101 }; // struct Device
102 } // namespace manipulation
103 } // namespace pyhpp
104 #endif // PYHPP_MANIPULATION_DEVICE_HH
pinocchio::Transform3s Transform3s
constraints::LiegroupSpacePtr_t LiegroupSpacePtr_t
pinocchio::ConfigurationIn_t ConfigurationIn_t
pinocchio::size_type size_type
pinocchio::Configuration_t Configuration_t
pinocchio::DevicePtr_t DevicePtr_t
shared_ptr< Device > DevicePtr_t
shared_ptr< Handle > HandlePtr_t
shared_ptr< Device > DevicePtr_t
::pinocchio::DataTpl< value_type, 0, ::pinocchio::JointCollectionDefaultTpl > Data
shared_ptr< Joint > JointPtr_t
::pinocchio::GeometryData GeomData
shared_ptr< LiegroupSpace > LiegroupSpacePtr_t
matrix_t::Index size_type
::pinocchio::SE3 Transform3s
vector_t Configuration_t
::pinocchio::GeometryModel GeomModel
::pinocchio::ModelTpl< value_type, 0, ::pinocchio::JointCollectionDefaultTpl > Model
shared_ptr< Gripper > GripperPtr_t
shared_ptr< Model > ModelPtr_t
Eigen::Ref< const Configuration_t > ConfigurationIn_t
hpp::pinocchio::GeomModel GeomModel
Definition: device.hh:53
hpp::pinocchio::DevicePtr_t PinDevicePtr_t
Definition: device.hh:65
hpp::pinocchio::GeomData GeomData
Definition: device.hh:51
hpp::pinocchio::Joint Joint
Definition: device.hh:67
hpp::pinocchio::ModelPtr_t ModelPtr_t
Definition: device.hh:50
hpp::manipulation::Handle Handle
Definition: device.hh:63
hpp::manipulation::DevicePtr_t DevicePtr_t
Definition: device.hh:64
hpp::pinocchio::Computation_t Computation_t
Definition: device.hh:61
hpp::pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t
Definition: device.hh:52
hpp::pinocchio::ConfigurationIn_t ConfigurationIn_t
Definition: device.hh:55
hpp::pinocchio::Model Model
Definition: device.hh:48
hpp::pinocchio::Transform3s Transform3s
Definition: device.hh:58
hpp::pinocchio::JointPtr_t JointPtr_t
Definition: device.hh:68
hpp::pinocchio::Configuration_t Configuration_t
Definition: device.hh:54
hpp::manipulation::HandlePtr_t HandlePtr_t
Definition: device.hh:62
hpp::pinocchio::Gripper Gripper
Definition: device.hh:60
hpp::pinocchio::GripperPtr_t GripperPtr_t
Definition: device.hh:59
hpp::pinocchio::value_type value_type
Definition: device.hh:57
hpp::pinocchio::Data Data
Definition: device.hh:49
hpp::pinocchio::Frame Frame
Definition: device.hh:66
hpp::pinocchio::size_type size_type
Definition: device.hh:56
Definition: fwd.hh:35
Definition: device.hh:75
const LiegroupSpacePtr_t & configSpace() const
Definition: device.cc:44
boost::python::list getJointNames()
Definition: device.cc:134
const Configuration_t & currentConfiguration() const
Definition: device.cc:55
Data & data()
Definition: device.cc:48
size_type numberDof() const
Definition: device.cc:54
size_type configSize() const
Definition: device.cc:53
const std::string & name() const
Definition: device.cc:43
GeomModel & geomModel()
Definition: device.cc:50
Model & model()
Definition: device.cc:47
Device(const DevicePtr_t &object)
Definition: device.cc:39
void computeFramesForwardKinematics()
Definition: device.cc:64
void setJointBounds(const char *jointName, boost::python::list jointBounds)
Definition: device.cc:89
void setRobotRootPosition(const std::string &robotName, const Transform3s &positionWRTParentJoint)
Definition: device.cc:71
void computeForwardKinematics(int flag)
Definition: device.cc:61
void updateGeometryPlacements()
Definition: device.cc:67
GeomData & geomData()
Definition: device.cc:49
PinDevicePtr_t asPinDevice()
GeomModel & visualModel()
Definition: device.cc:51
DevicePtr_t obj
Definition: device.hh:76
boost::python::list getJointConfig(const char *jointName)
Definition: device.cc:117