hpp-python: src/pyhpp/pinocchio/device.hh Source File

hpp-python 9.0.2 python bindings for HPP, based on boost python |

Loading...
Searching...
No Matches
device.hh
Go to the documentation of this file.
1//
2// Copyright (c) 2025, CNRS
3// Authors: Paul Sardin
4//
5
6#ifndef PYHPP_PINOCCHIO_DEVICE_HH
7#define PYHPP_PINOCCHIO_DEVICE_HH
8
9#include <hpp/manipulation/device.hh>
10#include <hpp/pinocchio/device.hh>
11#include <hpp/pinocchio/fwd.hh>
12
13namespace pyhpp {
14namespace pinocchio {
15
16 typedef hpp::pinocchio::Model Model;
17 typedef hpp::pinocchio::Data Data;
18 typedef hpp::pinocchio::ModelPtr_t ModelPtr_t;
19 typedef hpp::pinocchio::GeomData GeomData;
20 typedef hpp::pinocchio::LiegroupSpacePtr_t LiegroupSpacePtr_t;
21 typedef hpp::pinocchio::GeomModel GeomModel;
22 typedef hpp::pinocchio::Configuration_t Configuration_t;
23 typedef hpp::pinocchio::ConfigurationIn_t ConfigurationIn_t;
24 typedef hpp::pinocchio::JointIndex JointIndex;
25 typedef hpp::pinocchio::size_type size_type;
26 typedef hpp::pinocchio::Transform3s Transform3s;
27typedef hpp::pinocchio::DevicePtr_t DevicePtr_t;
28 typedef hpp::pinocchio::Computation_t Computation_t;
29 typedef hpp::pinocchio::value_type value_type;
30
31 struct Device {
32 DevicePtr_t obj;
33
34 Device(const DevicePtr_t& object) : obj(object) {}
35
36 const std::string& name() const { return obj->name(); }
37 const LiegroupSpacePtr_t& configSpace() const { return obj->configSpace(); }
38 Model& model() { return obj->model(); }
39 Data& data() { return obj->data(); }
40 GeomData& geomData() { return obj->geomData(); }
41 GeomModel& geomModel() { return obj->geomModel(); }
42 GeomModel& visualModel() { return obj->visualModel(); }
43 size_type configSize() const { return obj->configSize(); }
44 size_type numberDof() const { return obj->numberDof(); }
45 const Configuration_t& currentConfiguration() const {
46 return obj->currentConfiguration();
47 }
48 bool currentConfiguration(ConfigurationIn_t configuration) {
49 return obj->currentConfiguration(configuration);
50 }
51 void computeForwardKinematics(int flag) {
52 obj->computeForwardKinematics(flag);
53 }
54 void computeFramesForwardKinematics() {
55 obj->computeFramesForwardKinematics();
56 }
57 void updateGeometryPlacements() { obj->updateGeometryPlacements(); }
58 void removeJoints(const std::vector<std::string>& jointNames,
59 Configuration_t q) {
60 obj->removeJoints(jointNames, q);
61 }
62 hpp::manipulation::DevicePtr_t asManipulationDevice() const {
63 auto manipDevice = HPP_DYNAMIC_PTR_CAST(hpp::manipulation::Device, obj);
64 if (!manipDevice) {
65 throw std::runtime_error("Not a manipulation device²");
66 }
67 return manipDevice;
68 }
69};
70
71} // namespace pinocchio
72} // namespace pyhpp
73
74#endif // PYHPP_PINOCCHIO_DEVICE_HH
hpp::manipulation::Device
hpp::manipulation::DevicePtr_t
shared_ptr< Device > DevicePtr_t
hpp::pinocchio::DevicePtr_t
shared_ptr< Device > DevicePtr_t
hpp::pinocchio::Data
::pinocchio::DataTpl< value_type, 0, ::pinocchio::JointCollectionDefaultTpl > Data
hpp::pinocchio::Computation_t
Computation_t
hpp::pinocchio::GeomData
::pinocchio::GeometryData GeomData
hpp::pinocchio::LiegroupSpacePtr_t
shared_ptr< LiegroupSpace > LiegroupSpacePtr_t
hpp::pinocchio::size_type
matrix_t::Index size_type
hpp::pinocchio::Transform3s
::pinocchio::SE3 Transform3s
hpp::pinocchio::value_type
double value_type
hpp::pinocchio::Configuration_t
vector_t Configuration_t
hpp::pinocchio::JointIndex
::pinocchio::JointIndex JointIndex
hpp::pinocchio::GeomModel
::pinocchio::GeometryModel GeomModel
hpp::pinocchio::Model
::pinocchio::ModelTpl< value_type, 0, ::pinocchio::JointCollectionDefaultTpl > Model
hpp::pinocchio::ModelPtr_t
shared_ptr< Model > ModelPtr_t
hpp::pinocchio::ConfigurationIn_t
Eigen::Ref< const Configuration_t > ConfigurationIn_t
pyhpp::pinocchio
Definition fwd.hh:37
pyhpp
Definition fwd.hh:35
HPP_DYNAMIC_PTR_CAST
#define HPP_DYNAMIC_PTR_CAST(t, x)
pyhpp::pinocchio::Device::configSize
size_type configSize() const
Definition device.hh:43
pyhpp::pinocchio::Device::visualModel
GeomModel & visualModel()
Definition device.hh:42
pyhpp::pinocchio::Device::configSpace
const LiegroupSpacePtr_t & configSpace() const
Definition device.hh:37
pyhpp::pinocchio::Device::geomData
GeomData & geomData()
Definition device.hh:40
pyhpp::pinocchio::Device::computeFramesForwardKinematics
void computeFramesForwardKinematics()
Definition device.hh:54
pyhpp::pinocchio::Device::asManipulationDevice
hpp::manipulation::DevicePtr_t asManipulationDevice() const
Definition device.hh:62
pyhpp::pinocchio::Device::computeForwardKinematics
void computeForwardKinematics(int flag)
Definition device.hh:51
pyhpp::pinocchio::Device::currentConfiguration
bool currentConfiguration(ConfigurationIn_t configuration)
Definition device.hh:48
pyhpp::pinocchio::Device::currentConfiguration
const Configuration_t & currentConfiguration() const
Definition device.hh:45
pyhpp::pinocchio::Device::obj
DevicePtr_t obj
Definition device.hh:32
pyhpp::pinocchio::Device::updateGeometryPlacements
void updateGeometryPlacements()
Definition device.hh:57
pyhpp::pinocchio::Device::removeJoints
void removeJoints(const std::vector< std::string > &jointNames, Configuration_t q)
Definition device.hh:58
pyhpp::pinocchio::Device::name
const std::string & name() const
Definition device.hh:36
pyhpp::pinocchio::Device::geomModel
GeomModel & geomModel()
Definition device.hh:41
pyhpp::pinocchio::Device::model
Model & model()
Definition device.hh:38
pyhpp::pinocchio::Device::numberDof
size_type numberDof() const
Definition device.hh:44
pyhpp::pinocchio::Device::data
Data & data()
Definition device.hh:39
pyhpp::pinocchio::Device::Device
Device(const DevicePtr_t &object)
Definition device.hh:34