Skip to content

Conversation

@AdarshKaran
Copy link

🎉 New feature

Closes -

Summary

Added a new protobuf defn to support the dynamic_detachable_joint system discussed in Issue gazebosim/gz-sim#2362

NOTE: the header data part hasn't been implemented yet

Test it

Adding the plugin to robot model URDF/SDF

    <gazebo>
      <plugin filename="gz-sim-dynamic-detachable-joint-system"
            name="gz::sim::systems::DynamicDetachableJoint">
        <parent_link>robotiq_85_left_finger_tip_link</parent_link>
        <service_name>/payload/attach_detach</service_name>
        <output_topic>/child_state</output_topic>
        <attach_distance>0.25</attach_distance>
      </plugin>
    </gazebo>

GZ Service call command

# Attach
gz service -s /payload/attach_detach \
    --reqtype gz.msgs.AttachDetachRequest \
    --reptype gz.msgs.AttachDetachResponse \
    --timeout 3000 \
    --req 'child_model_name: "cube", 
           child_link_name: "link", 
           command: "attach"'

# Detach
gz service -s /payload/attach_detach \
    --reqtype gz.msgs.AttachDetachRequest \
    --reptype gz.msgs.AttachDetachResponse \
    --timeout 2000 \
    --req 'child_model_name: "cube", 
           child_link_name: "link", 
           command: "detach"'

ROS2 Service call command

# Attach
ros2 service call /payload/attach_detach \
    ros_gz_interfaces/srv/AttachDetach \
    "{child_model_name: 'cube', 
      child_link_name: 'link', 
      command: 'attach'}"

# Detach  
ros2 service call /payload/attach_detach \
    ros_gz_interfaces/srv/AttachDetach \
    "{child_model_name: 'cube', 
      child_link_name: 'link', 
      command: 'detach'}"

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • [] Was GenAI used to generate this PR? If so, make sure to add "Generated-by" to your commits. (See this policy for more info.)

Generated-by: Remove this if GenAI was not used.

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by and Generated-by messages.

Comment on lines 35 to 36
// TODO: Add optional header data
// gz.msgs.Header header = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider to add or remove this, otherwise If we enable in the future this we will break ABI and it couldn't be backported

Comment on lines 50 to 51
// TODO: Add optional header data
// gz.msgs.Header header = 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment

@github-project-automation github-project-automation bot moved this from Inbox to In review in Core development Sep 12, 2025
@arjo129
Copy link
Contributor

arjo129 commented Oct 7, 2025

Can you fix the DCO on this commit?
https://github.com/gazebosim/gz-msgs/pull/533/checks?check_run_id=50152792187

@AdarshKaran AdarshKaran force-pushed the plugin/dynamic_detachable_joint branch from b81297a to b959d86 Compare October 13, 2025 09:26
@AdarshKaran
Copy link
Author

I have signed it off and also addressed the comments. Kindly let me know once u test it

Copy link
Collaborator

@caguero caguero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the message!

@azeey
Copy link
Contributor

azeey commented Nov 26, 2025

@Mergifyio rebase

Signed-off-by: Adarsh Karan Kesavadas Prasanth <[email protected]>
Signed-off-by: Adarsh Karan Kesavadas Prasanth <[email protected]>
Signed-off-by: Adarsh Karan Kesavadas Prasanth <[email protected]>
Signed-off-by: Adarsh Karan Kesavadas Prasanth <[email protected]>
@mergify
Copy link
Contributor

mergify bot commented Nov 26, 2025

rebase

✅ Branch has been successfully rebased

@azeey azeey force-pushed the plugin/dynamic_detachable_joint branch from 8ae6452 to d43f7ad Compare November 26, 2025 15:43
Copy link
Contributor

@azeey azeey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! I have a few comments, but hopefully, they should not be difficult to address.

string child_link_name = 2;

/// \brief Command to attach or detach
string command = 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is a limited list of commands here, I suggest we change this to an enum, see

.

Comment on lines +45 to +52
message AttachDetachResponse
{
/// \brief True if the operation was successful
bool success = 1;

/// \brief Additional message or error description
string message = 2;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it could be a generic Result type. How about:

in proto/gz/msgs/result.proto

message Result
{
  /// \brief 0 if the operation was successful
  int error_code = 1;
  /// \brief Additional message or error description
  string message = 2;
}

/// \interface DynamicDetachableJoint
/// \brief Message for dynamic detachable joint

import "gz/msgs/header.proto";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The header is imported here, but it's not being used.

package gz.msgs;

option java_package = "com.gz.msgs";
option java_outer_classname = "DynamicDetachableJointProtos";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we move the AttachDetachResponse to Result, this will just be AttachDetachRequest


message AttachDetachRequest
{
/// \brief Name of the child model
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add header here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪵 jetty Gazebo Jetty

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

5 participants