Skip to content

Commit

Permalink
Refactor code
Browse files Browse the repository at this point in the history
- Add option to choose Ioana method or Yamane-san method
  • Loading branch information
cambel committed Feb 4, 2025
1 parent bbc50c6 commit 55d22a5
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 124 deletions.
2 changes: 2 additions & 0 deletions cartesian_compliance_controller/cfg/ComplianceController.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ gen.add("sel_ay", double_t, 0, "Selection matrix rotatory along y-axis. Floating
gen.add("sel_az", double_t, 0, "Selection matrix rotatory along z-axis. Floating value between [0,1]", 0.5, 0.0, 1.0)

gen.add("use_parallel_force_position_control", bool_t, 0, "Use parallel force-position control", True)
gen.add("use_parallel_force_position_control_in_gripper_frame", bool_t, 0, "Use parallel force-position control with selection matrix assumed to be given in the end-effector frame", True)
gen.add("use_parallel_force_position_control_powder_grinding", bool_t, 0, "Use parallel force-position control with selection matrix rotated based on normal of bowl's surface", True)

exit(gen.generate(PACKAGE, "cartesian_compliance_controller", "ComplianceController"))
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ class CartesianComplianceController

void update(const ros::Time& time, const ros::Duration& period);

void apply_selection_matrix_gripper_frame(ctrl::Vector6D pos_error_ref,
ctrl::Vector6D force_error_ref,
ctrl::Vector6D *pos_error_sel,
ctrl::Vector6D *force_error_sel,
ctrl::Matrix6D selection_matrix_gripper,
ctrl::Matrix3D R_gripper_to_ref);

void compute_selection_matrix_from_normal_surface(ctrl::Matrix6D *m_selection_matrix_pd);

typedef cartesian_controller_base::CartesianControllerBase<HardwareInterface> Base;
typedef cartesian_motion_controller::CartesianMotionController<HardwareInterface> MotionBase;
typedef cartesian_force_controller::CartesianForceController<HardwareInterface> ForceBase;
Expand All @@ -113,6 +122,8 @@ class CartesianComplianceController
ctrl::Matrix6D m_stiffness;
ctrl::Matrix6D m_selection_matrix;
bool m_use_parallel_force_position_control;
bool m_use_parallel_force_position_control_in_gripper_frame;
bool m_use_parallel_force_position_control_powder_grinding;
std::string m_compliance_ref_link;

// Dynamic reconfigure for stiffness
Expand Down
Loading

0 comments on commit 55d22a5

Please sign in to comment.