RSDK-13899 - Construct new kinematics on module startup from calibrated DH parameters for ur20 model#206
Conversation
…at the ROS2 driver does, but is less clean
|
|
||
| // Per-model static tables. To register a new UR model, add an entry here. | ||
| const std::map<std::string, ModelTables>& model_tables() { | ||
| static const std::map<std::string, ModelTables> tables = [] { |
There was a problem hiding this comment.
not for this PR. Any way we can extract these from know kinematics files?
…20260428-dh-params-kinematics
npmenard
left a comment
There was a problem hiding this comment.
LGTM i think this is good. just ask John/andrew a quick glance about the state machine changes if you haven't done so already
Left a couple of comments but nothing major
| const std::shared_lock rlock{config_mutex_}; | ||
| check_configured_(rlock); | ||
|
|
||
| if (!dh_kinematics_json_.empty()) { |
There was a problem hiding this comment.
What i am concerned about is if the arm first sends the default kinematic file and then later the updated one then what happens?
Since we read it during the config phase i think we can't get into this scenario but wanted to check
There was a problem hiding this comment.
UR does not change its calibrated DH on the fly, so the kinematics that we build on module startup is valid.
|
|
||
| if (model_ == URArm::model("ur20")) { | ||
| VIAM_SDK_LOG(info) << "Fetching calibrated DH parameters from controller for ur20"; | ||
| auto kin_info = current_state_->fetch_kinematics_info_(); |
There was a problem hiding this comment.
@andrew is there a chance the configuration is attempted when a connection to the client was not established?
| } | ||
| resp.emplace(k_get_state_description, cached_controlled_info->description); | ||
| } else if (kv.first == k_get_calibrated_dh_params) { | ||
| auto kin_info = current_state_->fetch_kinematics_info_(); |
There was a problem hiding this comment.
should cache the value, they are not expected to change right?
| } | ||
| auto kin = primary->getKinematicsInfo(); | ||
| if (!kin) { | ||
| throw std::runtime_error("controller has not delivered KinematicsInfo yet"); |
There was a problem hiding this comment.
should not but made it bullet proof.
There is a discrepancy between the TCP pose given to use through
GetEndPositionand performing forward kinematics.We close this discrepancy for the UR20 model.
On module startup we query the arm's controller for the the calibrated DH parameters and construct a brand new kinematics file (SVA type) on the fly which is then served through the
GetKinematicsendpoint.TODO: