Skip to content

Commit f091672

Browse files
AdarshKarancagueroarjo129
authored
Suggestion for new dynamic detachable joint plugin (#533)
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'}" ``` Signed-off-by: Adarsh Karan Kesavadas Prasanth <adarshkaran01@gmail.com> --------- Signed-off-by: Adarsh Karan Kesavadas Prasanth <adarshkaran01@gmail.com> Co-authored-by: Carlos Agüero <caguero@openrobotics.org> Co-authored-by: Arjo Chakravarty <arjoc@google.com>
1 parent 8ba4207 commit f091672

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2025 Open Source Robotics Foundation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Contributor: Adarsh Karan K P
18+
// Neobotix GmbH
19+
20+
syntax = "proto3";
21+
package gz.msgs;
22+
option java_package = "com.gz.msgs";
23+
option java_outer_classname = "DynamicDetachableJointProtos";
24+
25+
/// \ingroup gz.msgs
26+
/// \interface AttachDetachRequest
27+
/// \brief Request to attach or detach a runtime detachable joint.
28+
message AttachDetachRequest
29+
{
30+
/// \brief Command to apply.
31+
enum Command
32+
{
33+
/// \brief Invalid command.
34+
COMMAND_UNSPECIFIED = 0;
35+
36+
/// \brief Attach the requested child link.
37+
ATTACH = 1;
38+
39+
/// \brief Detach the requested child link.
40+
DETACH = 2;
41+
}
42+
43+
/// \brief Name of the child model.
44+
string child_model_name = 1;
45+
46+
/// \brief Name of the child link.
47+
string child_link_name = 2;
48+
49+
/// \brief Command to attach or detach.
50+
Command command = 3;
51+
}

proto/gz/msgs/result.proto

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (C) 2025 Open Source Robotics Foundation
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Contributor: Adarsh Karan K P
18+
// Neobotix GmbH
19+
20+
syntax = "proto3";
21+
package gz.msgs;
22+
option java_package = "com.gz.msgs";
23+
option java_outer_classname = "ResultProtos";
24+
25+
/// \ingroup gz.msgs
26+
/// \interface Result
27+
/// \brief Generic result message for service responses.
28+
message Result
29+
{
30+
/// \brief 0 if the operation was successful.
31+
int32 error_code = 1;
32+
33+
/// \brief Additional message or error description.
34+
string message = 2;
35+
}

0 commit comments

Comments
 (0)