Add support for controlling Z1 arm mounted on Aliengo quadruped (aliengoZ1 model) #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request addresses issue #6 by extending support for controlling the Unitree Z1 robotic arm when it is mounted on a quadruped; e.g., using the
aliengoZ1_description
model inunitree_ros
.Issue:
aliengoZ1_description
in GazeboCurrently, the
z1_controller
repository provides a ROS control interface for the Unitree Z1 robotic arm in the/z1_gazebo
namespace:z1_description
in Gazebo byz1_controller
However, there is a need to extend support for controlling the Z1 arm when it is mounted on a quadruped model with a different namespace. For example, using the
aliengoZ1_description
model where the namespace is/aliengoZ1_gazebo
:aliengoZ1_description
in Gazebo byz1_controller
; note dead and leaf topics due to namespace mismatchThe issue stems from a hard-coding of the
/z1_gazebo
namespace within the Z1 control interface for ROS Gazebo simulation,IOROS
:z1_controller/sim/IOROS.cpp
Lines 67 to 85 in 8eb6595
Proposed Changes:
Implement a mechanism to automatically detect the correct namespace based on the model being used when
z1_controller
begins execution, and use it to configure the namespace of ROS topics for Z1 joint control.Insights:
aliengoZ1_description
) initialize a ROS parameter called/robot_name
in their launch files, each specifying a model's unique namespace./robot_name
parameter can be retrieved and used to configure theIOROS
interface with the correct namespace for Z1 joints./robot_name
parameter; the original/z1_gazebo
namespace should be used in this case.Implementation details:
_rname
of typestd::string
to theIOROS
class.IOROS
initialization,_rname
stores/robot_name
retrieved from the ROS parameter server, defaulting to"z1"
if no such parameter is found._rname
configures the namespace for Z1 joints wheneverIOROS::_initSend()
orIOROS::_initRecv()
are invoked.Results:
The modification maintains
z1_controller
's functionality for control ofz1_description
in Gazebo, while enabling the capability ofz1_controller
to control the Z1 arm when it exists in a different robot namespace:z1_description
in Gazebo by updatedz1_controller
aliengoZ1_description
in Gazebo by updatedz1_controller
unitree_servo
andz1_controller
's demo trajectory visualized here