@@ -42,7 +42,8 @@ PYBIND11_MODULE(_core, m) {
4242 // HARDWARE MODULE
4343 auto hw = m.def_submodule (" hw" , " rcs fr3 module" );
4444
45- py::class_<rcs::hw::FR3State, rcs::common::RobotState>(hw, " FR3State" )
45+ py::object robot_state = (py::object) py::module_::import (" rcs" ).attr (" common" ).attr (" RobotState" );
46+ py::class_<rcs::hw::FR3State>(hw, " FR3State" , robot_state)
4647 .def (py::init<>());
4748 py::class_<rcs::hw::FR3Load>(hw, " FR3Load" )
4849 .def (py::init<>())
@@ -55,7 +56,8 @@ PYBIND11_MODULE(_core, m) {
5556 .value (" rcs_ik" , rcs::hw::IKSolver::rcs_ik)
5657 .export_values ();
5758
58- py::class_<rcs::hw::FR3Config, rcs::common::RobotConfig>(hw, " FR3Config" )
59+ py::object robot_config = (py::object) py::module_::import (" rcs" ).attr (" common" ).attr (" RobotConfig" );
60+ py::class_<rcs::hw::FR3Config>(hw, " FR3Config" , robot_config)
5961 .def (py::init<>())
6062 .def_readwrite (" ik_solver" , &rcs::hw::FR3Config::ik_solver)
6163 .def_readwrite (" speed_factor" , &rcs::hw::FR3Config::speed_factor)
@@ -66,7 +68,8 @@ PYBIND11_MODULE(_core, m) {
6668 .def_readwrite (" tcp_offset" , &rcs::hw::FR3Config::tcp_offset)
6769 .def_readwrite (" async_control" , &rcs::hw::FR3Config::async_control);
6870
69- py::class_<rcs::hw::FHConfig, rcs::common::GripperConfig>(hw, " FHConfig" )
71+ py::object gripper_config = (py::object) py::module_::import (" rcs" ).attr (" common" ).attr (" GripperConfig" );
72+ py::class_<rcs::hw::FHConfig>(hw, " FHConfig" , gripper_config)
7073 .def (py::init<>())
7174 .def_readwrite (" grasping_width" , &rcs::hw::FHConfig::grasping_width)
7275 .def_readwrite (" speed" , &rcs::hw::FHConfig::speed)
@@ -75,7 +78,8 @@ PYBIND11_MODULE(_core, m) {
7578 .def_readwrite (" epsilon_outer" , &rcs::hw::FHConfig::epsilon_outer)
7679 .def_readwrite (" async_control" , &rcs::hw::FHConfig::async_control);
7780
78- py::class_<rcs::hw::FHState, rcs::common::GripperState>(hw, " FHState" )
81+ py::object gripper_state = (py::object) py::module_::import (" rcs" ).attr (" common" ).attr (" GripperState" );
82+ py::class_<rcs::hw::FHState>(hw, " FHState" , gripper_state)
7983 .def (py::init<>())
8084 .def_readonly (" width" , &rcs::hw::FHState::width)
8185 .def_readonly (" is_grasped" , &rcs::hw::FHState::is_grasped)
@@ -87,8 +91,9 @@ PYBIND11_MODULE(_core, m) {
8791 &rcs::hw::FHState::max_unnormalized_width)
8892 .def_readonly (" temperature" , &rcs::hw::FHState::temperature);
8993
90- py::class_<rcs::hw::FR3, rcs::common::Robot, std::shared_ptr<rcs::hw::FR3>>(
91- hw, " FR3" )
94+ py::object robot = (py::object) py::module_::import (" rcs" ).attr (" common" ).attr (" Robot" );
95+ py::class_<rcs::hw::FR3, std::shared_ptr<rcs::hw::FR3>>(
96+ hw, " FR3" , robot)
9297 .def (py::init<const std::string &,
9398 std::optional<std::shared_ptr<rcs::common::IK>>>(),
9499 py::arg (" ip" ), py::arg (" ik" ) = std::nullopt )
@@ -117,8 +122,9 @@ PYBIND11_MODULE(_core, m) {
117122 &rcs::hw::FR3::set_cartesian_position_internal, py::arg (" pose" ),
118123 py::arg (" max_time" ), py::arg (" elbow" ), py::arg (" max_force" ) = 5 );
119124
120- py::class_<rcs::hw::FrankaHand, rcs::common::Gripper,
121- std::shared_ptr<rcs::hw::FrankaHand>>(hw, " FrankaHand" )
125+ py::object gripper = (py::object) py::module_::import (" rcs" ).attr (" common" ).attr (" Gripper" );
126+ py::class_<rcs::hw::FrankaHand,
127+ std::shared_ptr<rcs::hw::FrankaHand>>(hw, " FrankaHand" , gripper)
122128 .def (py::init<const std::string &, const rcs::hw::FHConfig &>(),
123129 py::arg (" ip" ), py::arg (" cfg" ))
124130 .def (" get_parameters" , &rcs::hw::FrankaHand::get_parameters)
0 commit comments