Variable Stiffness Controller#46
Conversation
Add ability to update Cartesian stiffness at runtime through a std_msgs/Float64MultiArray topic (6 elements: diagonal stiffness). Gated behind variable_stiffness.enabled parameter (default: false). Uses RealtimeBuffer pattern consistent with existing target_wrench. Damping remains parameter-controlled only.
This reverts commit b755ac6.
danielsanjosepro
left a comment
There was a problem hiding this comment.
Hey! Thank you a lot for the addition. It is definitely a nice feature (better than calling params services to modify it). I just left a few comments but it definitely looks good :)
| RCLCPP_INFO(get_node()->get_logger(), | ||
| "Variable stiffness received: [%.1f, %.1f, %.1f, %.1f, %.1f, %.1f]", | ||
| msg->data[0], msg->data[1], msg->data[2], | ||
| msg->data[3], msg->data[4], msg->data[5]); | ||
| } | ||
|
|
There was a problem hiding this comment.
This will spam messages if we are constantly changing stiffness, consider removing this or throttle it. Alternatively add a param to trigger logging
| max_stiffness: | ||
| translational: | ||
| type: double | ||
| default_value: 900.0 | ||
| description: "Maximum allowed translational stiffness value. Stiffness values above this will be clamped." | ||
| validation: | ||
| bounds<>: [0.0, 5000.0] | ||
| rotational: | ||
| type: double | ||
| default_value: 60.0 | ||
| description: "Maximum allowed rotational stiffness value. Stiffness values above this will be clamped." | ||
| validation: | ||
| bounds<>: [0.0, 100.0] |
There was a problem hiding this comment.
This file already defines stiffness bounds (see a few lines above). The bounds here are below what we defined above. Probably it makes sense to call this variable_max_stiffness or something similar to not confuse it with the other one
…riable_max_stiffness
|
@danielsanjosepro thank you for your comments, I believe I've fixed both issues |
|
Hey, so what is the status of this PR? We've addressed your comments, so I wonder whether we could proceed further? Or should we make further changes? |
|
It lools good to me thanks for this!! |
Runtime Variable Stiffness for Cartesian Impedance Controller
Summary
CartesianControllervia a ROS2 topicMotivation
Some modern learning-based approaches, such as Advanced Compliance Policy suggest extending the action space of the policy with stiffness prediction, for Variable Stiffness Controller. This could be easily supported by crisp_controllers as well with minimal changes. This PR does exactly that
Behaviour
This PR adds a topic-based override: publishing a
std_msgs/Float64MultiArraywith 6 elements to thetarget_stiffnesstopic immediately overrides the stiffness matrix. The pipeline is as follows:target_stiffness, the controller clips impedance to bounds and switches to using the topic-provided stiffnessTesting
From command line
Parameters Added
Notes
crisp_pyby adding one more method to the robot class. The implementation is ready and tested, so if you're interested in adding this feature, we're ready to open PR incrisp_pyas well