This commit is contained in:
TrivasZhang 2022-11-16 22:56:34 +08:00
parent ca57a1857c
commit 560fd88ef0
20 changed files with 21993 additions and 373 deletions

402
LICENSE
View File

@ -1,373 +1,29 @@
Mozilla Public License Version 2.0 BSD 3-Clause License
==================================
Copyright (c) 2016-2022 HangZhou YuShu TECHNOLOGY CO.,LTD. ("Unitree Robotics")
1. Definitions All rights reserved.
--------------
Redistribution and use in source and binary forms, with or without
1.1. "Contributor" modification, are permitted provided that the following conditions are met:
means each individual or legal entity that creates, contributes to
the creation of, or owns Covered Software. * Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1.2. "Contributor Version"
means the combination of the Contributions of others (if any) used * Redistributions in binary form must reproduce the above copyright notice,
by a Contributor and that particular Contributor's Contribution. this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
1.3. "Contribution"
means Covered Software of a particular Contributor. * Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
1.4. "Covered Software" this software without specific prior written permission.
means Source Code Form to which the initial Contributor has attached
the notice in Exhibit A, the Executable Form of such Source Code THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Form, and Modifications of such Source Code Form, in each case AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
including portions thereof. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
1.5. "Incompatible With Secondary Licenses" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
means DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
(a) that the initial Contributor has attached the notice described CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
in Exhibit B to the Covered Software; or OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
(b) that the Covered Software was made available under the terms of
version 1.1 or earlier of the License, but not also under the
terms of a Secondary License.
1.6. "Executable Form"
means any form of the work other than Source Code Form.
1.7. "Larger Work"
means a work that combines Covered Software with other material, in
a separate file or files, that is not Covered Software.
1.8. "License"
means this document.
1.9. "Licensable"
means having the right to grant, to the maximum extent possible,
whether at the time of the initial grant or subsequently, any and
all of the rights conveyed by this License.
1.10. "Modifications"
means any of the following:
(a) any file in Source Code Form that results from an addition to,
deletion from, or modification of the contents of Covered
Software; or
(b) any new file in Source Code Form that contains any Covered
Software.
1.11. "Patent Claims" of a Contributor
means any patent claim(s), including without limitation, method,
process, and apparatus claims, in any patent Licensable by such
Contributor that would be infringed, but for the grant of the
License, by the making, using, selling, offering for sale, having
made, import, or transfer of either its Contributions or its
Contributor Version.
1.12. "Secondary License"
means either the GNU General Public License, Version 2.0, the GNU
Lesser General Public License, Version 2.1, the GNU Affero General
Public License, Version 3.0, or any later versions of those
licenses.
1.13. "Source Code Form"
means the form of the work preferred for making modifications.
1.14. "You" (or "Your")
means an individual or a legal entity exercising rights under this
License. For legal entities, "You" includes any entity that
controls, is controlled by, or is under common control with You. For
purposes of this definition, "control" means (a) the power, direct
or indirect, to cause the direction or management of such entity,
whether by contract or otherwise, or (b) ownership of more than
fifty percent (50%) of the outstanding shares or beneficial
ownership of such entity.
2. License Grants and Conditions
--------------------------------
2.1. Grants
Each Contributor hereby grants You a world-wide, royalty-free,
non-exclusive license:
(a) under intellectual property rights (other than patent or trademark)
Licensable by such Contributor to use, reproduce, make available,
modify, display, perform, distribute, and otherwise exploit its
Contributions, either on an unmodified basis, with Modifications, or
as part of a Larger Work; and
(b) under Patent Claims of such Contributor to make, use, sell, offer
for sale, have made, import, and otherwise transfer either its
Contributions or its Contributor Version.
2.2. Effective Date
The licenses granted in Section 2.1 with respect to any Contribution
become effective for each Contribution on the date the Contributor first
distributes such Contribution.
2.3. Limitations on Grant Scope
The licenses granted in this Section 2 are the only rights granted under
this License. No additional rights or licenses will be implied from the
distribution or licensing of Covered Software under this License.
Notwithstanding Section 2.1(b) above, no patent license is granted by a
Contributor:
(a) for any code that a Contributor has removed from Covered Software;
or
(b) for infringements caused by: (i) Your and any other third party's
modifications of Covered Software, or (ii) the combination of its
Contributions with other software (except as part of its Contributor
Version); or
(c) under Patent Claims infringed by Covered Software in the absence of
its Contributions.
This License does not grant any rights in the trademarks, service marks,
or logos of any Contributor (except as may be necessary to comply with
the notice requirements in Section 3.4).
2.4. Subsequent Licenses
No Contributor makes additional grants as a result of Your choice to
distribute the Covered Software under a subsequent version of this
License (see Section 10.2) or under the terms of a Secondary License (if
permitted under the terms of Section 3.3).
2.5. Representation
Each Contributor represents that the Contributor believes its
Contributions are its original creation(s) or it has sufficient rights
to grant the rights to its Contributions conveyed by this License.
2.6. Fair Use
This License is not intended to limit any rights You have under
applicable copyright doctrines of fair use, fair dealing, or other
equivalents.
2.7. Conditions
Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
in Section 2.1.
3. Responsibilities
-------------------
3.1. Distribution of Source Form
All distribution of Covered Software in Source Code Form, including any
Modifications that You create or to which You contribute, must be under
the terms of this License. You must inform recipients that the Source
Code Form of the Covered Software is governed by the terms of this
License, and how they can obtain a copy of this License. You may not
attempt to alter or restrict the recipients' rights in the Source Code
Form.
3.2. Distribution of Executable Form
If You distribute Covered Software in Executable Form then:
(a) such Covered Software must also be made available in Source Code
Form, as described in Section 3.1, and You must inform recipients of
the Executable Form how they can obtain a copy of such Source Code
Form by reasonable means in a timely manner, at a charge no more
than the cost of distribution to the recipient; and
(b) You may distribute such Executable Form under the terms of this
License, or sublicense it under different terms, provided that the
license for the Executable Form does not attempt to limit or alter
the recipients' rights in the Source Code Form under this License.
3.3. Distribution of a Larger Work
You may create and distribute a Larger Work under terms of Your choice,
provided that You also comply with the requirements of this License for
the Covered Software. If the Larger Work is a combination of Covered
Software with a work governed by one or more Secondary Licenses, and the
Covered Software is not Incompatible With Secondary Licenses, this
License permits You to additionally distribute such Covered Software
under the terms of such Secondary License(s), so that the recipient of
the Larger Work may, at their option, further distribute the Covered
Software under the terms of either this License or such Secondary
License(s).
3.4. Notices
You may not remove or alter the substance of any license notices
(including copyright notices, patent notices, disclaimers of warranty,
or limitations of liability) contained within the Source Code Form of
the Covered Software, except that You may alter any license notices to
the extent required to remedy known factual inaccuracies.
3.5. Application of Additional Terms
You may choose to offer, and to charge a fee for, warranty, support,
indemnity or liability obligations to one or more recipients of Covered
Software. However, You may do so only on Your own behalf, and not on
behalf of any Contributor. You must make it absolutely clear that any
such warranty, support, indemnity, or liability obligation is offered by
You alone, and You hereby agree to indemnify every Contributor for any
liability incurred by such Contributor as a result of warranty, support,
indemnity or liability terms You offer. You may include additional
disclaimers of warranty and limitations of liability specific to any
jurisdiction.
4. Inability to Comply Due to Statute or Regulation
---------------------------------------------------
If it is impossible for You to comply with any of the terms of this
License with respect to some or all of the Covered Software due to
statute, judicial order, or regulation then You must: (a) comply with
the terms of this License to the maximum extent possible; and (b)
describe the limitations and the code they affect. Such description must
be placed in a text file included with all distributions of the Covered
Software under this License. Except to the extent prohibited by statute
or regulation, such description must be sufficiently detailed for a
recipient of ordinary skill to be able to understand it.
5. Termination
--------------
5.1. The rights granted under this License will terminate automatically
if You fail to comply with any of its terms. However, if You become
compliant, then the rights granted under this License from a particular
Contributor are reinstated (a) provisionally, unless and until such
Contributor explicitly and finally terminates Your grants, and (b) on an
ongoing basis, if such Contributor fails to notify You of the
non-compliance by some reasonable means prior to 60 days after You have
come back into compliance. Moreover, Your grants from a particular
Contributor are reinstated on an ongoing basis if such Contributor
notifies You of the non-compliance by some reasonable means, this is the
first time You have received notice of non-compliance with this License
from such Contributor, and You become compliant prior to 30 days after
Your receipt of the notice.
5.2. If You initiate litigation against any entity by asserting a patent
infringement claim (excluding declaratory judgment actions,
counter-claims, and cross-claims) alleging that a Contributor Version
directly or indirectly infringes any patent, then the rights granted to
You by any and all Contributors for the Covered Software under Section
2.1 of this License shall terminate.
5.3. In the event of termination under Sections 5.1 or 5.2 above, all
end user license agreements (excluding distributors and resellers) which
have been validly granted by You or Your distributors under this License
prior to termination shall survive termination.
************************************************************************
* *
* 6. Disclaimer of Warranty *
* ------------------------- *
* *
* Covered Software is provided under this License on an "as is" *
* basis, without warranty of any kind, either expressed, implied, or *
* statutory, including, without limitation, warranties that the *
* Covered Software is free of defects, merchantable, fit for a *
* particular purpose or non-infringing. The entire risk as to the *
* quality and performance of the Covered Software is with You. *
* Should any Covered Software prove defective in any respect, You *
* (not any Contributor) assume the cost of any necessary servicing, *
* repair, or correction. This disclaimer of warranty constitutes an *
* essential part of this License. No use of any Covered Software is *
* authorized under this License except under this disclaimer. *
* *
************************************************************************
************************************************************************
* *
* 7. Limitation of Liability *
* -------------------------- *
* *
* Under no circumstances and under no legal theory, whether tort *
* (including negligence), contract, or otherwise, shall any *
* Contributor, or anyone who distributes Covered Software as *
* permitted above, be liable to You for any direct, indirect, *
* special, incidental, or consequential damages of any character *
* including, without limitation, damages for lost profits, loss of *
* goodwill, work stoppage, computer failure or malfunction, or any *
* and all other commercial damages or losses, even if such party *
* shall have been informed of the possibility of such damages. This *
* limitation of liability shall not apply to liability for death or *
* personal injury resulting from such party's negligence to the *
* extent applicable law prohibits such limitation. Some *
* jurisdictions do not allow the exclusion or limitation of *
* incidental or consequential damages, so this exclusion and *
* limitation may not apply to You. *
* *
************************************************************************
8. Litigation
-------------
Any litigation relating to this License may be brought only in the
courts of a jurisdiction where the defendant maintains its principal
place of business and such litigation shall be governed by laws of that
jurisdiction, without reference to its conflict-of-law provisions.
Nothing in this Section shall prevent a party's ability to bring
cross-claims or counter-claims.
9. Miscellaneous
----------------
This License represents the complete agreement concerning the subject
matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent
necessary to make it enforceable. Any law or regulation which provides
that the language of a contract shall be construed against the drafter
shall not be used to construe this License against a Contributor.
10. Versions of the License
---------------------------
10.1. New Versions
Mozilla Foundation is the license steward. Except as provided in Section
10.3, no one other than the license steward has the right to modify or
publish new versions of this License. Each version will be given a
distinguishing version number.
10.2. Effect of New Versions
You may distribute the Covered Software under the terms of the version
of the License under which You originally received the Covered Software,
or under the terms of any subsequent version published by the license
steward.
10.3. Modified Versions
If you create software not governed by this License, and you want to
create a new license for such software, you may create and use a
modified version of this License if you rename the license and remove
any references to the name of the license steward (except to note that
such modified license differs from this License).
10.4. Distributing Source Code Form that is Incompatible With Secondary
Licenses
If You choose to distribute Source Code Form that is Incompatible With
Secondary Licenses under the terms of this version of the License, the
notice described in Exhibit B of this License must be attached.
Exhibit A - Source Code Form License Notice
-------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to look
for such a notice.
You may add additional accurate notices of copyright ownership.
Exhibit B - "Incompatible With Secondary Licenses" Notice
---------------------------------------------------------
This Source Code Form is "Incompatible With Secondary Licenses", as
defined by the Mozilla Public License, v. 2.0.

View File

@ -0,0 +1,13 @@
cmake_minimum_required(VERSION 3.0.2)
project(z1_description)
find_package(catkin REQUIRED COMPONENTS
urdf
xacro
)
catkin_package()
include_directories(
${catkin_INCLUDE_DIRS}
)

View File

@ -0,0 +1,40 @@
z1_gazebo:
# Publish all joint states -----------------------------------
joint_state_controller:
type: joint_state_controller/JointStateController
publish_rate: 1000
Joint01_controller:
type: unitree_legged_control/UnitreeJointController
joint: joint1
pid: {p: 300.0, i: 0.0, d: 5.0}
Joint02_controller:
type: unitree_legged_control/UnitreeJointController
joint: joint2
pid: {p: 300.0, i: 0.0, d: 5.0}
Joint03_controller:
type: unitree_legged_control/UnitreeJointController
joint: joint3
pid: {p: 300.0, i: 0.0, d: 5.0}
Joint04_controller:
type: unitree_legged_control/UnitreeJointController
joint: joint4
pid: {p: 300.0, i: 0.0, d: 5.0}
Joint05_controller:
type: unitree_legged_control/UnitreeJointController
joint: joint5
pid: {p: 300.0, i: 0.0, d: 5.0}
Joint06_controller:
type: unitree_legged_control/UnitreeJointController
joint: joint6
pid: {p: 300.0, i: 0.0, d: 5.0}
gripper_controller:
type: unitree_legged_control/UnitreeJointController
joint: jointGripper
pid: {p: 300.0, i: 0.0, d: 5.0}

View File

@ -0,0 +1,234 @@
Panels:
- Class: rviz/Displays
Help Height: 78
Name: Displays
Property Tree Widget:
Expanded:
- /Global Options1
- /Status1
- /RobotModel1
- /RobotModel1/Links1
- /TF1
- /TF1/Frames1
Splitter Ratio: 0.6125907897949219
Tree Height: 719
- Class: rviz/Selection
Name: Selection
- Class: rviz/Tool Properties
Expanded:
- /2D Pose Estimate1
- /2D Nav Goal1
- /Publish Point1
Name: Tool Properties
Splitter Ratio: 0.5886790156364441
- Class: rviz/Views
Expanded:
- /Current View1
Name: Views
Splitter Ratio: 0.5
- Class: rviz/Time
Experimental: false
Name: Time
SyncMode: 0
SyncSource: ""
Preferences:
PromptSaveOnExit: true
Toolbars:
toolButtonStyle: 2
Visualization Manager:
Class: ""
Displays:
- Alpha: 0.5
Cell Size: 1
Class: rviz/Grid
Color: 160; 160; 164
Enabled: true
Line Style:
Line Width: 0.029999999329447746
Value: Lines
Name: Grid
Normal Cell Count: 0
Offset:
X: 0
Y: 0
Z: 0
Plane: XY
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
- Alpha: 1
Class: rviz/RobotModel
Collision Enabled: false
Enabled: true
Links:
All Links Enabled: true
Expand Joint Details: false
Expand Link Details: false
Expand Tree: false
Link Tree Style: Links in Alphabetic Order
gripperMover:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
gripperStator:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
link00:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
link01:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
link02:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
link03:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
link04:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
link05:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
link06:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
world:
Alpha: 1
Show Axes: false
Show Trail: false
Name: RobotModel
Robot Description: robot_description
TF Prefix: ""
Update Interval: 0
Value: true
Visual Enabled: true
- Class: rviz/TF
Enabled: true
Frame Timeout: 15
Frames:
All Enabled: false
gripperMover:
Value: true
gripperStator:
Value: false
link00:
Value: true
link01:
Value: false
link02:
Value: true
link03:
Value: true
link04:
Value: true
link05:
Value: true
link06:
Value: true
world:
Value: true
Marker Alpha: 1
Marker Scale: 0.5
Name: TF
Show Arrows: false
Show Axes: true
Show Names: false
Tree:
world:
link00:
link01:
link02:
link03:
link04:
link05:
link06:
gripperStator:
gripperMover:
{}
Update Interval: 0
Value: true
Enabled: true
Global Options:
Background Color: 255; 255; 255
Default Light: true
Fixed Frame: world
Frame Rate: 30
Name: root
Tools:
- Class: rviz/Interact
Hide Inactive Objects: true
- Class: rviz/MoveCamera
- Class: rviz/Select
- Class: rviz/FocusCamera
- Class: rviz/Measure
- Class: rviz/SetInitialPose
Theta std deviation: 0.2617993950843811
Topic: /initialpose
X std deviation: 0.5
Y std deviation: 0.5
- Class: rviz/SetGoal
Topic: /move_base_simple/goal
- Class: rviz/PublishPoint
Single click: true
Topic: /clicked_point
Value: true
Views:
Current:
Class: rviz/Orbit
Distance: 0.9349431395530701
Enable Stereo Rendering:
Stereo Eye Separation: 0.05999999865889549
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Field of View: 0.7853981852531433
Focal Point:
X: -0.06341491639614105
Y: -0.17587876319885254
Z: 0.08242372423410416
Focal Shape Fixed Size: true
Focal Shape Size: 0.05000000074505806
Invert Z Axis: false
Name: Current View
Near Clip Distance: 0.009999999776482582
Pitch: 0.06539830565452576
Target Frame: <Fixed Frame>
Yaw: 1.5285662412643433
Saved: ~
Window Geometry:
Displays:
collapsed: false
Height: 1016
Hide Left Dock: false
Hide Right Dock: false
QMainWindow State: 000000ff00000000fd0000000400000000000001ce0000035afc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d0000035a000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007380000003efc0100000002fb0000000800540069006d0065010000000000000738000002eb00fffffffb0000000800540069006d006501000000000000045000000000000000000000044f0000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
collapsed: false
Tool Properties:
collapsed: false
Views:
collapsed: false
Width: 1848
X: 72
Y: 27

View File

@ -0,0 +1,24 @@
<launch>
<!-- <arg name="user_debug" default="false"/> -->
<arg name="UnitreeGripperYN" default="true"/>
<param name="robot_description" command="$(find xacro)/xacro --inorder '$(find z1_description)/xacro/robot.xacro'
UnitreeGripper:=$(arg UnitreeGripperYN)"/>
<!-- for higher robot_state_publisher average rate-->
<!-- <param name="rate" value="1000"/> -->
<!-- send fake joint values -->
<node pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" name="joint_state_publisher_gui">
<param name="use_gui" value="TRUE"/>
</node>
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher">
<param name="publish_frequency" type="double" value="1000.0"/>
</node>
<node pkg="rviz" type="rviz" name="rviz" respawn="false" output="screen"
args="-d $(find z1_description)/launch/setting.rviz"/>
</launch>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<package format="2">
<name>z1_description</name>
<version>0.0.0</version>
<description>The z1_description package</description>
<maintainer email="laikago@unitree.cc">unitree</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>urdf</build_depend>
<build_depend>xacro</build_depend>
<build_export_depend>urdf</build_export_depend>
<build_export_depend>xacro</build_export_depend>
<exec_depend>urdf</exec_depend>
<exec_depend>xacro</exec_depend>
</package>

View File

@ -0,0 +1,149 @@
<?xml version="1.0"?>
<robot name="z1_description" xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- Constants for robot dimensions -->
<xacro:property name="PI" value="3.1415926535897931"/>
<!-- Link 00 -->
<xacro:property name="L00_Mass" value="0.47247481"/>
<xacro:property name="L00_ComX" value="-0.00334984"/>
<xacro:property name="L00_ComY" value="-0.00013615"/>
<xacro:property name="L00_ComZ" value="0.02495843"/>
<xacro:property name="L00_Ixx" value="0.00037937"/>
<xacro:property name="L00_Ixy" value="0.00000035"/>
<xacro:property name="L00_Ixz" value="0.00001037"/>
<xacro:property name="L00_Iyy" value="0.00041521"/>
<xacro:property name="L00_Iyz" value="0.00000099"/>
<xacro:property name="L00_Izz" value="0.00053066"/>
<!-- Link 01 -->
<xacro:property name="L01_Mass" value="0.67332551"/>
<xacro:property name="L01_ComX" value="0.00000247"/>
<xacro:property name="L01_ComY" value="-0.00025198"/>
<xacro:property name="L01_ComZ" value="0.02317169"/>
<xacro:property name="L01_Ixx" value="0.00128328"/>
<xacro:property name="L01_Ixy" value="0.00000006"/>
<xacro:property name="L01_Ixz" value="0.00000040"/>
<xacro:property name="L01_Iyy" value="0.00071931"/>
<xacro:property name="L01_Iyz" value="-0.00000050"/>
<xacro:property name="L01_Izz" value="0.00083936"/>
<!-- Link 02 -->
<xacro:property name="L02_Mass" value="1.19132258"/>
<xacro:property name="L02_ComX" value="-0.11012601"/>
<xacro:property name="L02_ComY" value="0.00240029"/>
<xacro:property name="L02_ComZ" value="0.00158266"/>
<xacro:property name="L02_Ixx" value="0.00102138"/>
<xacro:property name="L02_Ixy" value="-0.00062358"/>
<xacro:property name="L02_Ixz" value="-0.00000513"/>
<xacro:property name="L02_Iyy" value="0.02429457"/>
<xacro:property name="L02_Iyz" value="0.00000210"/>
<xacro:property name="L02_Izz" value="0.02466114"/>
<!-- Link 03 -->
<xacro:property name="L03_Mass" value="0.83940874"/>
<xacro:property name="L03_ComX" value="0.10609208"/>
<xacro:property name="L03_ComY" value="-0.00541815"/>
<xacro:property name="L03_ComZ" value="0.03476383"/>
<xacro:property name="L03_Ixx" value="0.00108061"/>
<xacro:property name="L03_Ixy" value="0.00008669"/>
<xacro:property name="L03_Ixz" value="0.00208102"/>
<xacro:property name="L03_Iyy" value="0.00954238"/>
<xacro:property name="L03_Iyz" value="0.00001332"/>
<xacro:property name="L03_Izz" value="0.00886621"/>
<!-- Link 04 -->
<xacro:property name="L04_Mass" value="0.56404563"/>
<xacro:property name="L04_ComX" value="0.04366681"/>
<xacro:property name="L04_ComY" value="0.00364738"/>
<xacro:property name="L04_ComZ" value="-0.00170192"/>
<xacro:property name="L04_Ixx" value="0.00031576"/>
<xacro:property name="L04_Ixy" value="-0.00008130"/>
<xacro:property name="L04_Ixz" value="-0.00004091"/>
<xacro:property name="L04_Iyy" value="0.00092996"/>
<xacro:property name="L04_Iyz" value="0.00000596"/>
<xacro:property name="L04_Izz" value="0.00097912"/>
<!-- Link 05 -->
<xacro:property name="L05_Mass" value="0.38938492"/>
<xacro:property name="L05_ComX" value="0.03121533"/>
<xacro:property name="L05_ComY" value="0.0"/>
<xacro:property name="L05_ComZ" value="0.00646316"/>
<xacro:property name="L05_Ixx" value="0.00017605"/>
<xacro:property name="L05_Ixy" value="-0.00000040"/>
<xacro:property name="L05_Ixz" value="-0.00005689"/>
<xacro:property name="L05_Iyy" value="0.00055896"/>
<xacro:property name="L05_Iyz" value="0.00000013"/>
<xacro:property name="L05_Izz" value="0.00053860"/>
<!-- Link 06 -->
<xacro:property name="L06_Mass" value="0.28875807"/>
<xacro:property name="L06_ComX" value="0.02415690"/>
<xacro:property name="L06_ComY" value="-0.00017355"/>
<xacro:property name="L06_ComZ" value="-0.00143876"/>
<xacro:property name="L06_Ixx" value="0.00018328"/>
<xacro:property name="L06_Ixy" value="-0.00000122"/>
<xacro:property name="L06_Ixz" value="-0.00000054"/>
<xacro:property name="L06_Iyy" value="0.00014750"/>
<xacro:property name="L06_Iyz" value="-0.00000008"/>
<xacro:property name="L06_Izz" value="0.00014680"/>
<!-- Link Gripper Stator -->
<xacro:property name="GripperStator_Mass" value="0.52603655"/>
<xacro:property name="GripperStator_ComX" value="0.04764427"/>
<xacro:property name="GripperStator_ComY" value="-0.00035819"/>
<xacro:property name="GripperStator_ComZ" value="-0.00249162"/>
<xacro:property name="GripperStator_Ixx" value="0.00038683"/>
<xacro:property name="GripperStator_Ixy" value="0.00000359"/>
<xacro:property name="GripperStator_Ixz" value="-0.00007662"/>
<xacro:property name="GripperStator_Iyy" value="0.00068614"/>
<xacro:property name="GripperStator_Iyz" value="-0.00000209"/>
<xacro:property name="GripperStator_Izz" value="0.00066293"/>
<!-- Link Gripper Mover -->
<xacro:property name="GripperMover_Mass" value="0.27621302"/>
<xacro:property name="GripperMover_ComX" value="0.01320633"/>
<xacro:property name="GripperMover_ComY" value="0.00476708"/>
<xacro:property name="GripperMover_ComZ" value="0.00380534"/>
<xacro:property name="GripperMover_Ixx" value="0.00017716"/>
<xacro:property name="GripperMover_Ixy" value="-0.00001683"/>
<xacro:property name="GripperMover_Ixz" value="0.00001786"/>
<xacro:property name="GripperMover_Iyy" value="0.00026787"/>
<xacro:property name="GripperMover_Iyz" value="-0.00000262"/>
<xacro:property name="GripperMover_Izz" value="0.00035728"/>
<!-- joint limits -->
<!-- <xacro:property name="jointDamping" value="3.0"/> -->
<!-- <xacro:property name="jointFriction" value="2.0"/> -->
<xacro:property name="jointDamping" value="1.0"/>
<xacro:property name="jointFriction" value="1.0"/>
<xacro:property name="torqueMax" value="30.0"/>
<xacro:property name="velocityMax" value="10"/>
<xacro:property name="joint1_PositionMin" value="${-PI*150/180}"/>
<xacro:property name="joint1_PositionMax" value="${PI*150/180}"/>
<xacro:property name="joint2_PositionMin" value="0.0"/>
<xacro:property name="joint2_PositionMax" value="${PI}"/>
<xacro:property name="joint3_PositionMin" value="${-PI*274/180}"/>
<xacro:property name="joint3_PositionMax" value="0.0"/>
<xacro:property name="joint4_PositionMin" value="${-PI*100/180}"/>
<xacro:property name="joint4_PositionMax" value="${PI*90/180}"/>
<xacro:property name="joint5_PositionMin" value="${-PI*99/180}"/>
<xacro:property name="joint5_PositionMax" value="${PI*99/180}"/>
<xacro:property name="joint6_PositionMin" value="${-PI*160/180}"/>
<xacro:property name="joint6_PositionMax" value="${PI*160/180}"/>
<xacro:property name="Gripper_PositionMin" value="${-PI*90/180}"/>
<xacro:property name="Gripper_PositionMax" value="0.0"/>
<!-- collision size -->
<xacro:property name="motor_diameter" value="${0.065/2.0}"/>
<xacro:property name="motor_height" value="0.051"/>
<xacro:property name="arm1_diameter" value="${0.045/2.0}"/>
<xacro:property name="arm1_height" value="0.235"/>
<xacro:property name="arm2_diameter" value="${0.04/2.0}"/>
<xacro:property name="arm2_height" value="0.126"/>
<xacro:property name="gripperBox_X" value="0."/>
<xacro:property name="gripperBox_Y" value="0."/>
<xacro:property name="gripperBox_Z" value="0."/>
</robot>

View File

@ -0,0 +1,24 @@
<?xml version="1.0"?>
<robot>
<!-- ros_control plugin -->
<gazebo>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<robotNamespace>/z1_gazebo</robotNamespace>
<robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
</plugin>
</gazebo>
<gazebo reference="link04">
<self_collide>true</self_collide>
</gazebo>
<gazebo reference="link05">
<self_collide>true</self_collide>
</gazebo>
<gazebo reference="link06">
<self_collide>true</self_collide>
</gazebo>
</robot>

View File

@ -0,0 +1,321 @@
<?xml version="1.0"?>
<robot name="z1_description" xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:include filename="$(find z1_description)/xacro/const.xacro"/>
<xacro:include filename="$(find z1_description)/xacro/gazebo.xacro"/>
<xacro:include filename="$(find z1_description)/xacro/transmission.xacro"/>
<!-- <xacro:property name="UnitreeGripper" value="false"/> -->
<link name="world"/>
<joint name="base_static_joint" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="world"/>
<child link="link00"/>
</joint>
<link name="link00">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_Link00.dae" scale="1 1 1"/>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="${motor_height}" radius="${motor_diameter}"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 ${motor_height/2.0}"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="${L00_ComX} ${L00_ComY} ${L00_ComZ}"/>
<mass value="${L00_Mass}"/>
<inertia
ixx="${L00_Ixx}" ixy="${L00_Ixy}" ixz="${L00_Ixz}"
iyy="${L00_Iyy}" iyz="${L00_Iyz}"
izz="${L00_Izz}"/>
</inertial>
</link>
<joint name="joint1" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0.0585"/>
<parent link="link00"/>
<child link="link01"/>
<axis xyz="0 0 1"/>
<dynamics damping="${jointDamping}" friction="${jointFriction}"/>
<limit effort="${torqueMax}" velocity="${velocityMax}" lower="${joint1_PositionMin}" upper="${joint1_PositionMax}"/>
</joint>
<link name="link01">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_Link01.dae" scale="1 1 1"/>
</geometry>
</visual>
<!-- <collision>
<geometry>
<cylinder length="${2*motor_height}" radius="${motor_diameter}"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision> -->
<inertial>
<origin rpy="0 0 0" xyz="${L01_ComX} ${L01_ComY} ${L01_ComZ}"/>
<mass value="${L01_Mass}"/>
<inertia
ixx="${L01_Ixx}" ixy="${L01_Ixy}" ixz="${L01_Ixz}"
iyy="${L01_Iyy}" iyz="${L01_Iyz}"
izz="${L01_Izz}"/>
</inertial>
</link>
<joint name="joint2" type="revolute">
<origin rpy="0 0 0" xyz="0 0 0.045"/>
<parent link="link01"/>
<child link="link02"/>
<axis xyz="0 1 0"/>
<dynamics damping="${2*jointDamping}" friction="${2*jointFriction}"/>
<limit effort="${2*torqueMax}" velocity="${velocityMax}" lower="${joint2_PositionMin}" upper="${joint2_PositionMax}"/>
</joint>
<link name="link02">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_Link02.dae" scale="1 1 1"/>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="${2.0*motor_height}" radius="${motor_diameter}"/>
</geometry>
<origin rpy="${PI/2.0} 0 0" xyz="0 0 0"/>
</collision>
<collision>
<geometry>
<cylinder length="${arm1_height}" radius="${arm1_diameter}"/>
</geometry>
<origin rpy="0 ${PI/2.0} 0" xyz="${-0.045-arm1_height/2.0} 0 0"/>
</collision>
<collision>
<geometry>
<cylinder length="${motor_height}" radius="${motor_diameter}"/>
</geometry>
<origin rpy="${PI/2.0} 0 0" xyz="-0.35 0 0"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="${L02_ComX} ${L02_ComY} ${L02_ComZ}"/>
<mass value="${L02_Mass}"/>
<inertia
ixx="${L02_Ixx}" ixy="${L02_Ixy}" ixz="${L02_Ixz}"
iyy="${L02_Iyy}" iyz="${L02_Iyz}"
izz="${L02_Izz}"/>
</inertial>
</link>
<joint name="joint3" type="revolute">
<origin rpy="0 0 0" xyz="-0.35 0 0"/>
<parent link="link02"/>
<child link="link03"/>
<axis xyz="0 1 0"/>
<dynamics damping="${jointDamping}" friction="${jointFriction}"/>
<limit effort="${torqueMax}" velocity="${velocityMax}" lower="${joint3_PositionMin}" upper="${joint3_PositionMax}"/>
</joint>
<link name="link03">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_Link03.dae" scale="1 1 1"/>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="${arm2_height-0.01}" radius="${arm2_diameter}"/>
</geometry>
<origin rpy="0 ${PI/2.0} 0" xyz="${0.065+arm2_height/2.0} 0 0.055"/>
</collision>
<collision>
<geometry>
<cylinder length="0.059" radius="${motor_diameter}"/>
</geometry>
<origin rpy="0 ${PI/2.0} 0" xyz="${0.065+0.185-0.059/2.0} 0 0.055"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="${L03_ComX} ${L03_ComY} ${L03_ComZ}"/>
<mass value="${L03_Mass}"/>
<inertia
ixx="${L03_Ixx}" ixy="${L03_Ixy}" ixz="${L03_Ixz}"
iyy="${L03_Iyy}" iyz="${L03_Iyz}"
izz="${L03_Izz}"/>
</inertial>
</link>
<joint name="joint4" type="revolute">
<origin rpy="0 0 0" xyz="0.218 0 0.057"/>
<parent link="link03"/>
<child link="link04"/>
<axis xyz="0 1 0"/>
<dynamics damping="${jointDamping}" friction="${jointFriction}"/>
<limit effort="${torqueMax}" velocity="${velocityMax}" lower="${joint4_PositionMin}" upper="${joint4_PositionMax}"/>
</joint>
<link name="link04">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_Link04.dae" scale="1 1 1"/>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="0.073" radius="${motor_diameter}"/>
</geometry>
<origin rpy="${PI/2.0} 0 0" xyz="0.0472 0 0"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="${L04_ComX} ${L04_ComY} ${L04_ComZ}"/>
<mass value="${L04_Mass}"/>
<inertia
ixx="${L04_Ixx}" ixy="${L04_Ixy}" ixz="${L04_Ixz}"
iyy="${L04_Iyy}" iyz="${L04_Iyz}"
izz="${L04_Izz}"/>
</inertial>
</link>
<joint name="joint5" type="revolute">
<origin rpy="0 0 0" xyz="0.07 0.0 0.0"/>
<parent link="link04"/>
<child link="link05"/>
<axis xyz="0 0 1"/>
<dynamics damping="${jointDamping}" friction="${jointFriction}"/>
<limit effort="${torqueMax}" velocity="${velocityMax}" lower="${joint5_PositionMin}" upper="${joint5_PositionMax}"/>
</joint>
<link name="link05">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_Link05.dae" scale="1 1 1"/>
</geometry>
</visual>
<inertial>
<origin rpy="0 0 0" xyz="${L05_ComX} ${L05_ComY} ${L05_ComZ}"/>
<mass value="${L05_Mass}"/>
<inertia
ixx="${L05_Ixx}" ixy="${L05_Ixy}" ixz="${L05_Ixz}"
iyy="${L05_Iyy}" iyz="${L05_Iyz}"
izz="${L05_Izz}"/>
</inertial>
</link>
<joint name="joint6" type="revolute">
<origin rpy="0 0 0" xyz="0.0492 0.0 0.0"/>
<parent link="link05"/>
<child link="link06"/>
<axis xyz="1 0 0"/>
<dynamics damping="${jointDamping}" friction="${jointFriction}"/>
<limit effort="${torqueMax}" velocity="${velocityMax}" lower="${joint6_PositionMin}" upper="${joint6_PositionMax}"/>
</joint>
<link name="link06">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_Link06.dae" scale="1 1 1"/>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="${motor_height}" radius="${motor_diameter}"/>
</geometry>
<origin rpy="0 ${PI/2.0} 0" xyz="${motor_height/2.0} 0 0"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="${L06_ComX} ${L06_ComY} ${L06_ComZ}"/>
<mass value="${L06_Mass}"/>
<inertia
ixx="${L06_Ixx}" ixy="${L06_Ixy}" ixz="${L06_Ixz}"
iyy="${L06_Iyy}" iyz="${L06_Iyz}"
izz="${L06_Izz}"/>
</inertial>
</link>
<xacro:if value="$(arg UnitreeGripper)">
<joint name="gripperStator" type="fixed">
<origin rpy="0 0 0" xyz="0.051 0.0 0.0"/>
<parent link="link06"/>
<child link="gripperStator"/>
</joint>
<link name="gripperStator">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_GripperStator.dae" scale="1 1 1"/>
</geometry>
</visual>
<collision>
<geometry>
<cylinder length="${motor_height}" radius="${motor_diameter}"/>
</geometry>
<origin rpy="0 0 0" xyz="0 0 0"/>
</collision>
<inertial>
<origin rpy="0 0 0" xyz="${GripperStator_ComX} ${GripperStator_ComY} ${GripperStator_ComZ}"/>
<mass value="${GripperStator_Mass}"/>
<inertia
ixx="${GripperStator_Ixx}" ixy="${GripperStator_Ixy}" ixz="${GripperStator_Ixz}"
iyy="${GripperStator_Iyy}" iyz="${GripperStator_Iyz}"
izz="${GripperStator_Izz}"/>
</inertial>
</link>
<joint name="jointGripper" type="revolute">
<origin rpy="0 0 0" xyz="0.049 0.0 0"/>
<parent link="gripperStator"/>
<child link="gripperMover"/>
<axis xyz="0 1 0"/>
<dynamics damping="${jointDamping}" friction="${jointFriction}"/>
<limit effort="${torqueMax}" velocity="${velocityMax}" lower="${Gripper_PositionMin}" upper="${Gripper_PositionMax}"/>
</joint>
<link name="gripperMover">
<visual>
<origin rpy="0 0 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://z1_description/meshes/z1_GripperMover.dae" scale="1 1 1"/>
</geometry>
</visual>
<inertial>
<origin rpy="0 0 0" xyz="${GripperMover_ComX} ${GripperMover_ComY} ${GripperMover_ComZ}"/>
<mass value="${GripperMover_Mass}"/>
<inertia
ixx="${GripperMover_Ixx}" ixy="${GripperMover_Ixy}" ixz="${GripperMover_Ixz}"
iyy="${GripperMover_Iyy}" iyz="${GripperMover_Iyz}"
izz="${GripperMover_Izz}"/>
</inertial>
</link>
<xacro:motorTransmission name="Gripper"/>
<gazebo reference="gripperStator">
<self_collide>true</self_collide>
</gazebo>
<gazebo reference="gripperMover">
<self_collide>true</self_collide>
</gazebo>
</xacro:if>
<xacro:motorTransmission name="1"/>
<xacro:motorTransmission name="2"/>
<xacro:motorTransmission name="3"/>
<xacro:motorTransmission name="4"/>
<xacro:motorTransmission name="5"/>
<xacro:motorTransmission name="6"/>
</robot>

View File

@ -0,0 +1,20 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="motorTransmission" params="name">
<transmission name="JointTrans${name}">
<type>transmission_interface/SimpleTransmission</type>
<joint name="joint${name}">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
</joint>
<actuator name="Actuator${name}">
<hardwareInterface>hardware_interface/EffortJointInterface</hardwareInterface>
<mechanicalReduction>1</mechanicalReduction>
</actuator>
</transmission>
</xacro:macro>
</robot>

60
unitree_gazebo/launch/z1.launch Executable file
View File

@ -0,0 +1,60 @@
<launch>
<arg name="wname" default="earth"/>
<arg name="rname" default="z1"/>
<arg name="robot_path" value="(find $(arg rname)_description)"/>
<arg name="dollar" value="$"/>
<arg name="paused" default="true"/>
<arg name="use_sim_time" default="true"/>
<arg name="gui" default="true"/>
<arg name="headless" default="false"/>
<arg name="debug" default="false"/>
<!-- Debug mode will hung up the robot, use "true" or "false" to switch it. -->
<arg name="user_debug" default="false"/>
<arg name="UnitreeGripperYN" default="true"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find z1_gazebo)/worlds/$(arg wname).world"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="gui" value="$(arg gui)"/>
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="$(arg use_sim_time)"/>
<arg name="headless" value="$(arg headless)"/>
</include>
<!-- Load the URDF into the ROS Parameter Server -->
<param name="robot_description"
command="$(find xacro)/xacro --inorder '$(arg dollar)$(arg robot_path)/xacro/robot.xacro'
UnitreeGripper:=$(arg UnitreeGripperYN)"/>
<!-- Run a python script to the send a service call to gazebo_ros to spawn a URDF robot -->
<!-- Set trunk and joint positions at startup -->
<node pkg="gazebo_ros" type="spawn_model" name="urdf_spawner" respawn="false" output="screen"
args="-urdf -z 0.0 -model $(arg rname)_gazebo -param robot_description -unpause"/>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(arg dollar)$(arg robot_path)/config/robot_control.yaml" command="load"/>
<!-- load the controllers -->
<group unless="$(arg UnitreeGripperYN)">
<node pkg="controller_manager" type="spawner" name="controller_spawner" respawn="false"
output="screen" ns="/$(arg rname)_gazebo" args="joint_state_controller
Joint01_controller Joint02_controller Joint03_controller
Joint04_controller Joint05_controller Joint06_controller"/>
</group>
<group if="$(arg UnitreeGripperYN)">
<node pkg="controller_manager" type="spawner" name="controller_spawner" respawn="false"
output="screen" ns="/$(arg rname)_gazebo" args="joint_state_controller
Joint01_controller Joint02_controller Joint03_controller
Joint04_controller Joint05_controller Joint06_controller
gripper_controller"/>
</group>
<!-- convert joint states to TF transforms for rviz, etc -->
<node pkg="robot_state_publisher" type="robot_state_publisher" name="robot_state_publisher"
respawn="false" output="screen">
<remap from="/joint_states" to="/$(arg rname)_gazebo/joint_states"/>
</node>
</launch>