@@ -126,7 +126,6 @@ PYBIND11_MODULE(_core, m) {
126126 py::object robot_config =
127127 (py::object)py::module_::import (" rcs" ).attr (" common" ).attr (" RobotConfig" );
128128 py::class_<rcs::hw::FrankaConfig>(hw, " FrankaConfig" , robot_config)
129- .def (py::init<>())
130129 .def_readwrite (" ik_solver" , &rcs::hw::FrankaConfig::ik_solver)
131130 .def_readwrite (" speed_factor" , &rcs::hw::FrankaConfig::speed_factor)
132131 .def_readwrite (" load_parameters" , &rcs::hw::FrankaConfig::load_parameters)
@@ -139,16 +138,116 @@ PYBIND11_MODULE(_core, m) {
139138 .def_readwrite (" ignore_realtime" , &rcs::hw::FrankaConfig::ignore_realtime)
140139 .def_readwrite (" ip" , &rcs::hw::FrankaConfig::ip);
141140
141+ rcs::hw::FR3Config default_fr3_config;
142142 py::class_<rcs::hw::FR3Config, rcs::hw::FrankaConfig>(hw, " FR3Config" )
143- .def (py::init<>());
143+ .def (py::init (
144+ [](const std::string& ip, rcs::hw::IKSolver ik_solver,
145+ double speed_factor,
146+ std::optional<rcs::hw::FrankaLoad> load_parameters,
147+ std::optional<rcs::common::Pose> nominal_end_effector_frame,
148+ std::optional<rcs::common::Pose> world_to_robot,
149+ bool async_control, bool tcp_offset_configured_in_desk,
150+ bool ignore_realtime, rcs::common::Pose tcp_offset,
151+ std::string attachment_site,
152+ std::string kinematic_model_path) {
153+ rcs::hw::FR3Config cfg;
154+ cfg.ik_solver = ik_solver;
155+ cfg.speed_factor = speed_factor;
156+ cfg.load_parameters = load_parameters;
157+ cfg.nominal_end_effector_frame = nominal_end_effector_frame;
158+ cfg.world_to_robot = world_to_robot;
159+ cfg.async_control = async_control;
160+ cfg.tcp_offset_configured_in_desk =
161+ tcp_offset_configured_in_desk;
162+ cfg.ignore_realtime = ignore_realtime;
163+ cfg.ip = ip;
164+ cfg.tcp_offset = tcp_offset;
165+ cfg.attachment_site = attachment_site;
166+ cfg.kinematic_model_path = kinematic_model_path;
167+ return cfg;
168+ }),
169+ py::arg (" ip" ), py::arg (" ik_solver" ) = default_fr3_config.ik_solver ,
170+ py::arg (" speed_factor" ) = default_fr3_config.speed_factor ,
171+ py::arg (" load_parameters" ) = default_fr3_config.load_parameters ,
172+ py::arg (" nominal_end_effector_frame" ) =
173+ default_fr3_config.nominal_end_effector_frame ,
174+ py::arg (" world_to_robot" ) = default_fr3_config.world_to_robot ,
175+ py::arg (" async_control" ) = default_fr3_config.async_control ,
176+ py::arg (" tcp_offset_configured_in_desk" ) =
177+ default_fr3_config.tcp_offset_configured_in_desk ,
178+ py::arg (" ignore_realtime" ) = default_fr3_config.ignore_realtime ,
179+ py::arg (" tcp_offset" ) = default_fr3_config.tcp_offset ,
180+ py::arg (" attachment_site" ) = default_fr3_config.attachment_site ,
181+ py::arg (" kinematic_model_path" ) =
182+ default_fr3_config.kinematic_model_path );
183+ rcs::hw::PandaConfig default_panda_config;
144184 py::class_<rcs::hw::PandaConfig, rcs::hw::FrankaConfig>(hw, " PandaConfig" )
145- .def (py::init<>());
185+ .def (py::init (
186+ [](const std::string& ip, rcs::hw::IKSolver ik_solver,
187+ double speed_factor,
188+ std::optional<rcs::hw::FrankaLoad> load_parameters,
189+ std::optional<rcs::common::Pose> nominal_end_effector_frame,
190+ std::optional<rcs::common::Pose> world_to_robot,
191+ bool async_control, bool tcp_offset_configured_in_desk,
192+ bool ignore_realtime, rcs::common::Pose tcp_offset,
193+ std::string attachment_site,
194+ std::string kinematic_model_path) {
195+ rcs::hw::PandaConfig cfg;
196+ cfg.ik_solver = ik_solver;
197+ cfg.speed_factor = speed_factor;
198+ cfg.load_parameters = load_parameters;
199+ cfg.nominal_end_effector_frame = nominal_end_effector_frame;
200+ cfg.world_to_robot = world_to_robot;
201+ cfg.async_control = async_control;
202+ cfg.tcp_offset_configured_in_desk =
203+ tcp_offset_configured_in_desk;
204+ cfg.ignore_realtime = ignore_realtime;
205+ cfg.ip = ip;
206+ cfg.tcp_offset = tcp_offset;
207+ cfg.attachment_site = attachment_site;
208+ cfg.kinematic_model_path = kinematic_model_path;
209+ return cfg;
210+ }),
211+ py::arg (" ip" ), py::arg (" ik_solver" ) = default_panda_config.ik_solver ,
212+ py::arg (" speed_factor" ) = default_panda_config.speed_factor ,
213+ py::arg (" load_parameters" ) = default_panda_config.load_parameters ,
214+ py::arg (" nominal_end_effector_frame" ) =
215+ default_panda_config.nominal_end_effector_frame ,
216+ py::arg (" world_to_robot" ) = default_panda_config.world_to_robot ,
217+ py::arg (" async_control" ) = default_panda_config.async_control ,
218+ py::arg (" tcp_offset_configured_in_desk" ) =
219+ default_panda_config.tcp_offset_configured_in_desk ,
220+ py::arg (" ignore_realtime" ) = default_panda_config.ignore_realtime ,
221+ py::arg (" tcp_offset" ) = default_panda_config.tcp_offset ,
222+ py::arg (" attachment_site" ) = default_panda_config.attachment_site ,
223+ py::arg (" kinematic_model_path" ) =
224+ default_panda_config.kinematic_model_path );
146225
147226 py::object gripper_config =
148227 (py::object)py::module_::import (" rcs" ).attr (" common" ).attr (
149228 " GripperConfig" );
229+ rcs::hw::FHConfig default_gripper_config;
150230 py::class_<rcs::hw::FHConfig>(hw, " FHConfig" , gripper_config)
151- .def (py::init<>())
231+ .def (py::init ([](const std::string& ip, double grasping_width,
232+ double speed, double force, double epsilon_inner,
233+ double epsilon_outer, bool async_control) {
234+ rcs::hw::FHConfig cfg;
235+ cfg.ip = ip;
236+ cfg.grasping_width = grasping_width;
237+ cfg.speed = speed;
238+ cfg.force = force;
239+ cfg.epsilon_inner = epsilon_inner;
240+ cfg.epsilon_outer = epsilon_outer;
241+ cfg.async_control = async_control;
242+ return cfg;
243+ }),
244+ py::arg (" ip" ),
245+ py::arg (" grasping_width" ) = default_gripper_config.grasping_width ,
246+ py::arg (" speed" ) = default_gripper_config.speed ,
247+ py::arg (" force" ) = default_gripper_config.force ,
248+ py::arg (" epsilon_inner" ) = default_gripper_config.epsilon_inner ,
249+ py::arg (" epsilon_outer" ) = default_gripper_config.epsilon_outer ,
250+ py::arg (" async_control" ) = default_gripper_config.async_control )
152251 .def_readwrite (" ip" , &rcs::hw::FHConfig::ip)
153252 .def_readwrite (" grasping_width" , &rcs::hw::FHConfig::grasping_width)
154253 .def_readwrite (" speed" , &rcs::hw::FHConfig::speed)
0 commit comments