first commit
This commit is contained in:
parent
146c1796de
commit
eedf98969d
|
|
@ -0,0 +1 @@
|
|||
88854784ba84f0bec7587b78efcbf02f
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
cmake_minimum_required(VERSION 2.8.3)
|
||||
|
||||
project(2foot)
|
||||
|
||||
find_package(catkin REQUIRED)
|
||||
|
||||
catkin_package()
|
||||
|
||||
find_package(roslaunch)
|
||||
|
||||
foreach(dir config launch meshes urdf)
|
||||
install(DIRECTORY ${dir}/
|
||||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir})
|
||||
endforeach(dir)
|
||||
|
|
@ -0,0 +1 @@
|
|||
controller_joint_names: ['', 'jlf0_link', 'jlf1_link', 'jlf2_link', 'jlf3_link', 'jrf0_link', 'jrf1_link', 'jrf2_link', 'jrf3_link', ]
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<launch>
|
||||
<arg
|
||||
name="model" />
|
||||
<param
|
||||
name="robot_description"
|
||||
textfile="$(find 2foot)/urdf/2foot.urdf" />
|
||||
<node
|
||||
name="joint_state_publisher_gui"
|
||||
pkg="joint_state_publisher_gui"
|
||||
type="joint_state_publisher_gui" />
|
||||
<node
|
||||
name="robot_state_publisher"
|
||||
pkg="robot_state_publisher"
|
||||
type="robot_state_publisher" />
|
||||
<node
|
||||
name="rviz"
|
||||
pkg="rviz"
|
||||
type="rviz"
|
||||
args="-d $(find 2foot)/urdf.rviz" />
|
||||
</launch>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<launch>
|
||||
<include
|
||||
file="$(find gazebo_ros)/launch/empty_world.launch" />
|
||||
<node
|
||||
name="tf_footprint_base"
|
||||
pkg="tf"
|
||||
type="static_transform_publisher"
|
||||
args="0 0 0 0 0 0 base_link base_footprint 40" />
|
||||
<node
|
||||
name="spawn_model"
|
||||
pkg="gazebo_ros"
|
||||
type="spawn_model"
|
||||
args="-file $(find 2foot)/urdf/2foot.urdf -urdf -model 2foot"
|
||||
output="screen" />
|
||||
<node
|
||||
name="fake_joint_calibration"
|
||||
pkg="rostopic"
|
||||
type="rostopic"
|
||||
args="pub /calibrated std_msgs/Bool true" />
|
||||
</launch>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,21 @@
|
|||
<package format="2">
|
||||
<name>2foot</name>
|
||||
<version>1.0.0</version>
|
||||
<description>
|
||||
<p>URDF Description package for 2foot</p>
|
||||
<p>This package contains configuration data, 3D models and launch files
|
||||
for 2foot robot</p>
|
||||
</description>
|
||||
<author>TODO</author>
|
||||
<maintainer email="TODO@email.com" />
|
||||
<license>BSD</license>
|
||||
<buildtool_depend>catkin</buildtool_depend>
|
||||
<depend>roslaunch</depend>
|
||||
<depend>robot_state_publisher</depend>
|
||||
<depend>rviz</depend>
|
||||
<depend>joint_state_publisher_gui</depend>
|
||||
<depend>gazebo</depend>
|
||||
<export>
|
||||
<architecture_independent />
|
||||
</export>
|
||||
</package>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
Link Name,Center of Mass X,Center of Mass Y,Center of Mass Z,Center of Mass Roll,Center of Mass Pitch,Center of Mass Yaw,Mass,Moment Ixx,Moment Ixy,Moment Ixz,Moment Iyy,Moment Iyz,Moment Izz,Visual X,Visual Y,Visual Z,Visual Roll,Visual Pitch,Visual Yaw,Mesh Filename,Color Red,Color Green,Color Blue,Color Alpha,Collision X,Collision Y,Collision Z,Collision Roll,Collision Pitch,Collision Yaw,Collision Mesh Filename,Material Name,SW Components,Coordinate System,Axis Name,Joint Name,Joint Type,Joint Origin X,Joint Origin Y,Joint Origin Z,Joint Origin Roll,Joint Origin Pitch,Joint Origin Yaw,Parent,Joint Axis X,Joint Axis Y,Joint Axis Z,Limit Effort,Limit Velocity,Limit Lower,Limit Upper,Calibration rising,Calibration falling,Dynamics Damping,Dynamics Friction,Safety Soft Upper,Safety Soft Lower,Safety K Position,Safety K Velocity
|
||||
head_link,0.00637927718522201,8.36838553548436E-05,0.0502679117290854,0,0,0,0.104147639434427,0.000119888626287878,4.26649795023379E-08,-3.14056079328627E-06,9.2091610344693E-05,1.01375294153974E-07,3.18810914232645E-05,0,0,0,0,0,0,package://2foot/meshes/head_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/head_link.STL,,主体-2;bateria 9v-1;Step Up-1;3D_PCB1_2026-08-10.step-1/Board~RkW7.step-1;Freenove ESP32-S3-WROOM-CAM-1;3D_PCB1_2026-08-10.step-1/H15~HDR-TH_20P-P2.54-V-F~HDR-F-2.54_1x20~VMZC.step-1/HDR-TH_20P-P2.54-V-F~HDR-F-2.54_1x20~Z7qR.step-1;3D_PCB1_2026-08-10.step-1/H1~HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~UsHF.step-1/HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~m73r.step-1;3D_PCB1_2026-08-10.step-1/H8~HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~Shzr.step-1/HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~m73r.step-1;3D_PCB1_2026-08-10.step-1/H2~HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~Ckmi.step-1/HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~m73r.step-1;3D_PCB1_2026-08-10.step-1/H4~HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~7m2w.step-1/HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~m73r.step-1;3D_PCB1_2026-08-10.step-1/H6~HDR-TH_20P-P2.54-V-F~HDR-F-2.54_1x20~FFBa.step-1/HDR-TH_20P-P2.54-V-F~HDR-F-2.54_1x20~Z7qR.step-1;3D_PCB1_2026-08-10.step-1/H3~HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~2T1y.step-1/HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~m73r.step-1;3D_PCB1_2026-08-10.step-1/H5~HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~T7xH.step-1/HDR-TH_20P-P2.54-V-M-1~HDR-M-2.54_1x20~m73r.step-1;舵机总体-5/Servo-1;舵机总体-4/Servo-1,head,,,,0,0,0,0,0,0,,0,0,0,,,,,,,,,,,,
|
||||
lf0_link,2.5034674019167E-06,-0.00399152370097755,-0.0136055723537577,0,0,0,0.0155246301341258,1.99164881392775E-06,-4.82887905395487E-10,-2.07253296776602E-10,2.02900387840545E-06,2.49004321417992E-07,1.54078395860252E-06,0,0,0,0,0,0,package://2foot/meshes/lf0_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/lf0_link.STL,,右腿胯骨-18;舵机总体-8/Servo-1,lf0,lf0_hige,jlf0_link,revolute,-0.0031441,0.025688,-0.006475,0,0,0,head_link,0,0,-1,0,0,0,0,,,,,,,,
|
||||
lf1_link,2.91696425805399E-06,0.004390376864982,-0.0296712953157869,0,0,0,0.013323922418148,2.72143018103993E-06,4.82887905395412E-10,2.07253296776833E-10,2.92090153101514E-06,-3.25175555348237E-08,9.23918900070304E-07,0,0,0,0,0,0,package://2foot/meshes/lf1_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/lf1_link.STL,,右大腿-3;舵机总体-10/Servo-1,lf1,lf1_hige,jlf1_link,revolute,9.7027E-05,0.011975,-0.012388,0,0,0,lf0_link,0,-1,0,0,0,0,0,,,,,,,,
|
||||
lf2_link,2.43737372657149E-06,0.00363613025354126,-0.0425732788173739,0,0,0,0.0159456077850123,5.35424510746978E-06,4.82887905395677E-10,2.07253296776739E-10,5.71315402728463E-06,-2.13454759600996E-08,1.09035404123551E-06,0,0,0,0,0,0,package://2foot/meshes/lf2_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/lf2_link.STL,,右小腿-2;舵机总体-12/Servo-1,lf2,lf2_hige,jlf2_link,revolute,9.7027E-05,-0.008475,-0.040938,0,0,0,lf1_link,0,1,0,0,0,0,0,,,,,,,,
|
||||
lf3_link,-4.82253126321552E-16,-0.000451394188820231,-0.0198245674059442,0,0,0,0.0192906631601767,3.18209633375994E-06,3.34527248954873E-21,1.76056444695768E-21,6.55022061625284E-06,2.53604908486043E-07,7.24649308736933E-06,0,0,0,0,0,0,package://2foot/meshes/lf3_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/lf3_link.STL,,玉足-4,lf3,lf3_hige,jlf3_link,revolute,9.7027E-05,-0.006475,-0.060937,0,0,0,lf2_link,0,-1,0,0,0,0,0,,,,,,,,
|
||||
rf0_link,-2.50346740203813E-06,0.00399152370097733,-0.0136055723537577,0,0,0,0.0155246301341258,1.99164881392775E-06,-4.82887905395413E-10,2.07253296776268E-10,2.02900387840545E-06,-2.49004321417992E-07,1.54078395860252E-06,0,0,0,0,0,0,package://2foot/meshes/rf0_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/rf0_link.STL,,右腿胯骨-16;舵机总体-9/Servo-1,rf0,rf0_hige,jrf0_link,revolute,-0.0033382,-0.025687,-0.006475,0,0,0,head_link,0,0,-1,0,0,0,0,,,,,,,,
|
||||
rf1_link,-2.91696425855359E-06,-0.00439037686498245,-0.0296712953157865,0,0,0,0.0133239224181479,2.72143018103992E-06,4.82887905395081E-10,-2.07253296776895E-10,2.92090153101514E-06,3.25175555348265E-08,9.23918900070297E-07,0,0,0,0,0,0,package://2foot/meshes/rf1_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/rf1_link.STL,,右大腿-2;舵机总体-11/Servo-1,rf1,rf1_hige,jrf1_link,revolute,-9.7027E-05,-0.011975,-0.012388,0,0,0,rf0_link,0,1,0,0,0,0,0,,,,,,,,
|
||||
rf2_link,-2.43737372681782E-06,-0.00363613025354104,-0.0425732788173739,0,0,0,0.0159456077850122,5.35424510746977E-06,4.82887905394926E-10,-2.0725329677683E-10,5.71315402728462E-06,2.13454759600991E-08,1.0903540412355E-06,0,0,0,0,0,0,package://2foot/meshes/rf2_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/rf2_link.STL,,右小腿-1;舵机总体-13/Servo-1,rf2,lf2_hige,jrf2_link,revolute,-9.7027E-05,0.008475,-0.040937,0,0,0,rf1_link,0,1,0,0,0,0,0,,,,,,,,
|
||||
rf3_link,8.18789480661053E-16,0.000451394188820897,-0.0198245674059443,0,0,0,0.0192906631601768,3.18209633375994E-06,8.58350838304875E-21,2.39867798130625E-21,6.55022061625285E-06,-2.53604908486041E-07,7.24649308736931E-06,0,0,0,0,0,0,package://2foot/meshes/rf3_link.STL,1,1,1,1,0,0,0,0,0,0,package://2foot/meshes/rf3_link.STL,,玉足-3,rf3,rf3_hige,jrf3_link,revolute,-9.7027E-05,0.006475,-0.060938,0,0,0,rf2_link,0,1,0,0,0,0,0,,,,,,,,
|
||||
|
|
|
@ -0,0 +1,565 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
|
||||
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
|
||||
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
|
||||
<robot
|
||||
name="2foot">
|
||||
<link
|
||||
name="head_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="0.00637927718522201 8.36838553548436E-05 0.0502679117290854"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.104147639434427" />
|
||||
<inertia
|
||||
ixx="0.000119888626287878"
|
||||
ixy="4.26649795023379E-08"
|
||||
ixz="-3.14056079328627E-06"
|
||||
iyy="9.2091610344693E-05"
|
||||
iyz="1.01375294153974E-07"
|
||||
izz="3.18810914232645E-05" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/head_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/head_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<link
|
||||
name="lf0_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="2.5034674019167E-06 -0.00399152370097755 -0.0136055723537577"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0155246301341258" />
|
||||
<inertia
|
||||
ixx="1.99164881392775E-06"
|
||||
ixy="-4.82887905395487E-10"
|
||||
ixz="-2.07253296776602E-10"
|
||||
iyy="2.02900387840545E-06"
|
||||
iyz="2.49004321417992E-07"
|
||||
izz="1.54078395860252E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf0_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf0_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf0_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-0.0031441 0.025688 -0.006475"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="head_link" />
|
||||
<child
|
||||
link="lf0_link" />
|
||||
<axis
|
||||
xyz="0 0 -1" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
<link
|
||||
name="lf1_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="2.91696425805399E-06 0.004390376864982 -0.0296712953157869"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.013323922418148" />
|
||||
<inertia
|
||||
ixx="2.72143018103993E-06"
|
||||
ixy="4.82887905395412E-10"
|
||||
ixz="2.07253296776833E-10"
|
||||
iyy="2.92090153101514E-06"
|
||||
iyz="-3.25175555348237E-08"
|
||||
izz="9.23918900070304E-07" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf1_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf1_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf1_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="9.7027E-05 0.011975 -0.012388"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="lf0_link" />
|
||||
<child
|
||||
link="lf1_link" />
|
||||
<axis
|
||||
xyz="0 -1 0" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
<link
|
||||
name="lf2_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="2.43737372657149E-06 0.00363613025354126 -0.0425732788173739"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0159456077850123" />
|
||||
<inertia
|
||||
ixx="5.35424510746978E-06"
|
||||
ixy="4.82887905395677E-10"
|
||||
ixz="2.07253296776739E-10"
|
||||
iyy="5.71315402728463E-06"
|
||||
iyz="-2.13454759600996E-08"
|
||||
izz="1.09035404123551E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf2_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf2_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf2_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="9.7027E-05 -0.008475 -0.040938"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="lf1_link" />
|
||||
<child
|
||||
link="lf2_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
<link
|
||||
name="lf3_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-4.82253126321552E-16 -0.000451394188820231 -0.0198245674059442"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0192906631601767" />
|
||||
<inertia
|
||||
ixx="3.18209633375994E-06"
|
||||
ixy="3.34527248954873E-21"
|
||||
ixz="1.76056444695768E-21"
|
||||
iyy="6.55022061625284E-06"
|
||||
iyz="2.53604908486043E-07"
|
||||
izz="7.24649308736933E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf3_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf3_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf3_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="9.7027E-05 -0.006475 -0.060937"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="lf2_link" />
|
||||
<child
|
||||
link="lf3_link" />
|
||||
<axis
|
||||
xyz="0 -1 0" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf0_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-2.50346740203813E-06 0.00399152370097733 -0.0136055723537577"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0155246301341258" />
|
||||
<inertia
|
||||
ixx="1.99164881392775E-06"
|
||||
ixy="-4.82887905395413E-10"
|
||||
ixz="2.07253296776268E-10"
|
||||
iyy="2.02900387840545E-06"
|
||||
iyz="-2.49004321417992E-07"
|
||||
izz="1.54078395860252E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf0_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf0_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf0_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-0.0033382 -0.025687 -0.006475"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="head_link" />
|
||||
<child
|
||||
link="rf0_link" />
|
||||
<axis
|
||||
xyz="0 0 -1" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf1_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-2.91696425855359E-06 -0.00439037686498245 -0.0296712953157865"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0133239224181479" />
|
||||
<inertia
|
||||
ixx="2.72143018103992E-06"
|
||||
ixy="4.82887905395081E-10"
|
||||
ixz="-2.07253296776895E-10"
|
||||
iyy="2.92090153101514E-06"
|
||||
iyz="3.25175555348265E-08"
|
||||
izz="9.23918900070297E-07" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf1_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf1_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf1_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-9.7027E-05 -0.011975 -0.012388"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="rf0_link" />
|
||||
<child
|
||||
link="rf1_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf2_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-2.43737372681782E-06 -0.00363613025354104 -0.0425732788173739"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0159456077850122" />
|
||||
<inertia
|
||||
ixx="5.35424510746977E-06"
|
||||
ixy="4.82887905394926E-10"
|
||||
ixz="-2.0725329677683E-10"
|
||||
iyy="5.71315402728462E-06"
|
||||
iyz="2.13454759600991E-08"
|
||||
izz="1.0903540412355E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf2_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf2_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf2_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-9.7027E-05 0.008475 -0.040937"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="rf1_link" />
|
||||
<child
|
||||
link="rf2_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf3_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="8.18789480661053E-16 0.000451394188820897 -0.0198245674059443"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0192906631601768" />
|
||||
<inertia
|
||||
ixx="3.18209633375994E-06"
|
||||
ixy="8.58350838304875E-21"
|
||||
ixz="2.39867798130625E-21"
|
||||
iyy="6.55022061625285E-06"
|
||||
iyz="-2.53604908486041E-07"
|
||||
izz="7.24649308736931E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf3_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf3_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf3_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-9.7027E-05 0.006475 -0.060938"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="rf2_link" />
|
||||
<child
|
||||
link="rf3_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="-1.0"
|
||||
upper="1.0"
|
||||
effort="10.0"
|
||||
velocity="5.0" />
|
||||
</joint>
|
||||
</robot>
|
||||
|
|
@ -0,0 +1,565 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- This URDF was automatically created by SolidWorks to URDF Exporter! Originally created by Stephen Brawner (brawner@gmail.com)
|
||||
Commit Version: 1.6.0-4-g7f85cfe Build Version: 1.6.7995.38578
|
||||
For more information, please see http://wiki.ros.org/sw_urdf_exporter -->
|
||||
<robot
|
||||
name="2foot">
|
||||
<link
|
||||
name="head_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="0.00637927718522201 8.36838553548436E-05 0.0502679117290854"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.104147639434427" />
|
||||
<inertia
|
||||
ixx="0.000119888626287878"
|
||||
ixy="4.26649795023379E-08"
|
||||
ixz="-3.14056079328627E-06"
|
||||
iyy="9.2091610344693E-05"
|
||||
iyz="1.01375294153974E-07"
|
||||
izz="3.18810914232645E-05" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/head_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/head_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<link
|
||||
name="lf0_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="2.5034674019167E-06 -0.00399152370097755 -0.0136055723537577"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0155246301341258" />
|
||||
<inertia
|
||||
ixx="1.99164881392775E-06"
|
||||
ixy="-4.82887905395487E-10"
|
||||
ixz="-2.07253296776602E-10"
|
||||
iyy="2.02900387840545E-06"
|
||||
iyz="2.49004321417992E-07"
|
||||
izz="1.54078395860252E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf0_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf0_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf0_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-0.0031441 0.025688 -0.006475"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="head_link" />
|
||||
<child
|
||||
link="lf0_link" />
|
||||
<axis
|
||||
xyz="0 0 -1" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
<link
|
||||
name="lf1_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="2.91696425805399E-06 0.004390376864982 -0.0296712953157869"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.013323922418148" />
|
||||
<inertia
|
||||
ixx="2.72143018103993E-06"
|
||||
ixy="4.82887905395412E-10"
|
||||
ixz="2.07253296776833E-10"
|
||||
iyy="2.92090153101514E-06"
|
||||
iyz="-3.25175555348237E-08"
|
||||
izz="9.23918900070304E-07" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf1_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf1_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf1_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="9.7027E-05 0.011975 -0.012388"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="lf0_link" />
|
||||
<child
|
||||
link="lf1_link" />
|
||||
<axis
|
||||
xyz="0 -1 0" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
<link
|
||||
name="lf2_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="2.43737372657149E-06 0.00363613025354126 -0.0425732788173739"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0159456077850123" />
|
||||
<inertia
|
||||
ixx="5.35424510746978E-06"
|
||||
ixy="4.82887905395677E-10"
|
||||
ixz="2.07253296776739E-10"
|
||||
iyy="5.71315402728463E-06"
|
||||
iyz="-2.13454759600996E-08"
|
||||
izz="1.09035404123551E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf2_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf2_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf2_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="9.7027E-05 -0.008475 -0.040938"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="lf1_link" />
|
||||
<child
|
||||
link="lf2_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
<link
|
||||
name="lf3_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-4.82253126321552E-16 -0.000451394188820231 -0.0198245674059442"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0192906631601767" />
|
||||
<inertia
|
||||
ixx="3.18209633375994E-06"
|
||||
ixy="3.34527248954873E-21"
|
||||
ixz="1.76056444695768E-21"
|
||||
iyy="6.55022061625284E-06"
|
||||
iyz="2.53604908486043E-07"
|
||||
izz="7.24649308736933E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf3_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/lf3_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jlf3_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="9.7027E-05 -0.006475 -0.060937"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="lf2_link" />
|
||||
<child
|
||||
link="lf3_link" />
|
||||
<axis
|
||||
xyz="0 -1 0" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf0_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-2.50346740203813E-06 0.00399152370097733 -0.0136055723537577"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0155246301341258" />
|
||||
<inertia
|
||||
ixx="1.99164881392775E-06"
|
||||
ixy="-4.82887905395413E-10"
|
||||
ixz="2.07253296776268E-10"
|
||||
iyy="2.02900387840545E-06"
|
||||
iyz="-2.49004321417992E-07"
|
||||
izz="1.54078395860252E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf0_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf0_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf0_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-0.0033382 -0.025687 -0.006475"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="head_link" />
|
||||
<child
|
||||
link="rf0_link" />
|
||||
<axis
|
||||
xyz="0 0 -1" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf1_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-2.91696425855359E-06 -0.00439037686498245 -0.0296712953157865"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0133239224181479" />
|
||||
<inertia
|
||||
ixx="2.72143018103992E-06"
|
||||
ixy="4.82887905395081E-10"
|
||||
ixz="-2.07253296776895E-10"
|
||||
iyy="2.92090153101514E-06"
|
||||
iyz="3.25175555348265E-08"
|
||||
izz="9.23918900070297E-07" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf1_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf1_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf1_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-9.7027E-05 -0.011975 -0.012388"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="rf0_link" />
|
||||
<child
|
||||
link="rf1_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf2_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="-2.43737372681782E-06 -0.00363613025354104 -0.0425732788173739"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0159456077850122" />
|
||||
<inertia
|
||||
ixx="5.35424510746977E-06"
|
||||
ixy="4.82887905394926E-10"
|
||||
ixz="-2.0725329677683E-10"
|
||||
iyy="5.71315402728462E-06"
|
||||
iyz="2.13454759600991E-08"
|
||||
izz="1.0903540412355E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf2_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf2_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf2_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-9.7027E-05 0.008475 -0.040937"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="rf1_link" />
|
||||
<child
|
||||
link="rf2_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
<link
|
||||
name="rf3_link">
|
||||
<inertial>
|
||||
<origin
|
||||
xyz="8.18789480661053E-16 0.000451394188820897 -0.0198245674059443"
|
||||
rpy="0 0 0" />
|
||||
<mass
|
||||
value="0.0192906631601768" />
|
||||
<inertia
|
||||
ixx="3.18209633375994E-06"
|
||||
ixy="8.58350838304875E-21"
|
||||
ixz="2.39867798130625E-21"
|
||||
iyy="6.55022061625285E-06"
|
||||
iyz="-2.53604908486041E-07"
|
||||
izz="7.24649308736931E-06" />
|
||||
</inertial>
|
||||
<visual>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf3_link.STL" />
|
||||
</geometry>
|
||||
<material
|
||||
name="">
|
||||
<color
|
||||
rgba="1 1 1 1" />
|
||||
</material>
|
||||
</visual>
|
||||
<collision>
|
||||
<origin
|
||||
xyz="0 0 0"
|
||||
rpy="0 0 0" />
|
||||
<geometry>
|
||||
<mesh
|
||||
filename="package://2foot/meshes/rf3_link.STL" />
|
||||
</geometry>
|
||||
</collision>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
<contact>
|
||||
<origin xyz="0 0 0" rpy="0 0 0"/>
|
||||
</contact>
|
||||
</link>
|
||||
<joint
|
||||
name="jrf3_link"
|
||||
type="revolute">
|
||||
<origin
|
||||
xyz="-9.7027E-05 0.006475 -0.060938"
|
||||
rpy="0 0 0" />
|
||||
<parent
|
||||
link="rf2_link" />
|
||||
<child
|
||||
link="rf3_link" />
|
||||
<axis
|
||||
xyz="0 1 0" />
|
||||
<limit
|
||||
lower="0"
|
||||
upper="0"
|
||||
effort="0"
|
||||
velocity="0" />
|
||||
</joint>
|
||||
</robot>
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
asset_path: /home/zhenai/AI/RL/bot/2foot/urdf/2foot.urdf
|
||||
usd_dir: /home/zhenai/AI/RL/bot/
|
||||
usd_file_name: 2foot/2foot.usda
|
||||
force_usd_conversion: true
|
||||
make_instanceable: true
|
||||
fix_base: false
|
||||
root_link_name: null
|
||||
link_density: 0.0
|
||||
merge_fixed_joints: false
|
||||
convert_mimic_joints_to_normal_joints: false
|
||||
joint_drive:
|
||||
drive_type: force
|
||||
target_type: position
|
||||
gains:
|
||||
stiffness: 100.0
|
||||
damping: 1.0
|
||||
collision_from_visuals: false
|
||||
collision_type: Convex Hull
|
||||
self_collision: false
|
||||
replace_cylinders_with_capsules: false
|
||||
merge_mesh: false
|
||||
ros_package_paths: []
|
||||
robot_type: Default
|
||||
run_asset_transformer: true
|
||||
run_multi_physics_conversion: true
|
||||
debug_mode: false
|
||||
##
|
||||
# Generated by UrdfConverter on 2026-09-08 at 18:58:47.
|
||||
##
|
||||
Binary file not shown.
|
|
@ -50,7 +50,7 @@ with contextlib.suppress(ImportError):
|
|||
# -- argparse ----------------------------------------------------------------
|
||||
parser = argparse.ArgumentParser(description="Play a checkpoint of an RL agent from RSL-RL.")
|
||||
parser.add_argument("--video", action="store_true", default=False, help="Record videos during play.")
|
||||
parser.add_argument("--video_length", type=int, default=200, help="Length of the recorded video (in steps).")
|
||||
parser.add_argument("--video_length", type=int, default=500, help="Length of the recorded video (in steps).")
|
||||
parser.add_argument(
|
||||
"--disable_fabric", action="store_true", default=False, help="Disable fabric and use USD I/O operations."
|
||||
)
|
||||
|
|
|
|||
|
|
@ -5,37 +5,51 @@
|
|||
|
||||
from isaaclab.utils.configclass import configclass
|
||||
|
||||
from isaaclab_rl.rsl_rl import RslRlMLPModelCfg, RslRlOnPolicyRunnerCfg, RslRlPpoAlgorithmCfg
|
||||
from isaaclab_rl.rsl_rl import (
|
||||
RslRlCNNModelCfg,
|
||||
RslRlMLPModelCfg,
|
||||
RslRlOnPolicyRunnerCfg,
|
||||
RslRlPpoAlgorithmCfg,
|
||||
)
|
||||
|
||||
|
||||
|
||||
@configclass
|
||||
class PPORunnerCfg(RslRlOnPolicyRunnerCfg):
|
||||
num_steps_per_env = 16
|
||||
max_iterations = 150
|
||||
save_interval = 50
|
||||
max_iterations = 5000
|
||||
save_interval = 200
|
||||
experiment_name = "cartpole_direct"
|
||||
actor = RslRlMLPModelCfg(
|
||||
hidden_dims=[32, 32],
|
||||
activation="elu",
|
||||
obs_groups = {"actor": ["policy", "camera"], "critic": ["policy"]}
|
||||
actor = RslRlCNNModelCfg(
|
||||
hidden_dims=[512, 256, 256, 128],
|
||||
activation="relu",
|
||||
obs_normalization=False,
|
||||
distribution_cfg=RslRlMLPModelCfg.GaussianDistributionCfg(init_std=1.0),
|
||||
distribution_cfg=RslRlCNNModelCfg.GaussianDistributionCfg(init_std=1.0),
|
||||
cnn_cfg=RslRlCNNModelCfg.CNNCfg(
|
||||
output_channels=[16,16,16],
|
||||
kernel_size=[8, 4, 3],
|
||||
stride=[8,4,2],
|
||||
activation="relu",
|
||||
),
|
||||
)
|
||||
critic = RslRlMLPModelCfg(
|
||||
hidden_dims=[32, 32],
|
||||
activation="elu",
|
||||
hidden_dims=[1024, 512, 512, 256, 256, 128],
|
||||
activation="relu",
|
||||
obs_normalization=False,
|
||||
)
|
||||
|
||||
algorithm = RslRlPpoAlgorithmCfg(
|
||||
value_loss_coef=1.0,
|
||||
use_clipped_value_loss=True,
|
||||
clip_param=0.2,
|
||||
entropy_coef=0.005,
|
||||
num_learning_epochs=5,
|
||||
num_mini_batches=4,
|
||||
learning_rate=1.0e-3,
|
||||
schedule="adaptive",
|
||||
gamma=0.99,
|
||||
lam=0.95,
|
||||
desired_kl=0.01,
|
||||
max_grad_norm=1.0,
|
||||
value_loss_coef=1.0, #价值函数损失系数
|
||||
use_clipped_value_loss=True, #是否使用裁剪值损失
|
||||
clip_param=0.2, #裁剪参数
|
||||
entropy_coef=0.05, #熵系数,探索的奖励
|
||||
num_learning_epochs=5, #学习的轮数
|
||||
num_mini_batches=4, #小批量的数量
|
||||
learning_rate=5.0e-3, #学习率
|
||||
schedule="adaptive", #学习率调度器类型
|
||||
gamma=0.99, #折扣因子
|
||||
lam=0.95, #GAE的lambda参数
|
||||
desired_kl=0.01, #期望的KL散度
|
||||
max_grad_norm=1.0, #梯度裁剪的最大范数
|
||||
)
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
|
||||
'''# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
|
@ -177,4 +177,526 @@ class TwofootbotEnvCfg(ManagerBasedRLEnvCfg):
|
|||
self.viewer.eye = (8.0, 0.0, 5.0)
|
||||
# simulation settings
|
||||
self.sim.dt = 1 / 120
|
||||
self.sim.render_interval = self.decimation'''
|
||||
|
||||
# Copyright (c) 2022-2026, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
|
||||
# All rights reserved.
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
import math
|
||||
from dataclasses import MISSING
|
||||
from pathlib import Path
|
||||
import torch
|
||||
from isaaclab.sensors import ContactSensorCfg
|
||||
from isaaclab_newton.physics import MJWarpSolverCfg, NewtonCfg, NewtonCollisionPipelineCfg, NewtonShapeCfg
|
||||
from isaaclab_newton.sensors import ContactSensorCfg as NewtonContactSensorCfg
|
||||
from isaaclab_ovphysx.sensors import ContactSensorCfg as OvPhysXContactSensorCfg
|
||||
from isaaclab_physx.physics import PhysxCfg
|
||||
from isaaclab_physx.sensors import ContactSensorCfg as PhysXContactSensorCfg
|
||||
|
||||
from isaaclab.actuators import ImplicitActuatorCfg
|
||||
|
||||
import isaaclab.sim as sim_utils
|
||||
from isaaclab.assets import ArticulationCfg, AssetBaseCfg
|
||||
from isaaclab.envs import ManagerBasedRLEnvCfg
|
||||
from isaaclab.managers import CurriculumTermCfg as CurrTerm
|
||||
from isaaclab.managers import EventTermCfg as EventTerm
|
||||
from isaaclab.managers import ObservationGroupCfg as ObsGroup
|
||||
from isaaclab.managers import ObservationTermCfg as ObsTerm
|
||||
from isaaclab.managers import RewardTermCfg as RewTerm
|
||||
from isaaclab.managers import SceneEntityCfg
|
||||
from isaaclab.managers import TerminationTermCfg as DoneTerm
|
||||
from isaaclab.scene import InteractiveSceneCfg
|
||||
from isaaclab.sensors import RayCasterCfg, patterns
|
||||
from isaaclab.sim import SimulationCfg
|
||||
from isaaclab.terrains import TerrainImporterCfg
|
||||
from isaaclab.utils.assets import ISAAC_NUCLEUS_DIR, ISAACLAB_NUCLEUS_DIR
|
||||
from isaaclab.utils.configclass import configclass
|
||||
from isaaclab.utils.noise import UniformNoiseCfg as Unoise
|
||||
|
||||
import isaaclab_tasks.manager_based.locomotion.velocity.mdp as mdp
|
||||
#from isaaclab.managers import mdp as base_mdp
|
||||
from isaaclab_tasks.utils import PresetCfg, preset
|
||||
|
||||
from isaaclab.sensors import CameraCfg
|
||||
from isaaclab.sensors import TiledCameraCfg
|
||||
from isaaclab.sim import PinholeCameraCfg
|
||||
|
||||
JOINT_NAMES = [ # 定义机器人需要控制的八个关节名称。
|
||||
"jlf0_link",
|
||||
"jlf1_link",
|
||||
"jlf2_link",
|
||||
"jlf3_link",
|
||||
"jrf0_link",
|
||||
"jrf1_link",
|
||||
"jrf2_link",
|
||||
"jrf3_link",
|
||||
]
|
||||
BOT_PACKAGE_PATH = Path(__file__).resolve().parents[6] / "bot/2foot" # 获取机器人 ROS 包目录。
|
||||
URDF_PATH = BOT_PACKAGE_PATH / "urdf/2foot.urdf" # 指定正式使用的 2foot URDF 文件。
|
||||
|
||||
TOFOOTBOT_CFG = ArticulationCfg(
|
||||
spawn=sim_utils.UrdfFileCfg(
|
||||
asset_path=str(URDF_PATH),
|
||||
fix_base=False,
|
||||
activate_contact_sensors=True,
|
||||
ros_package_paths=[{"name": "2foot", "path": str(BOT_PACKAGE_PATH)}],
|
||||
joint_drive=sim_utils.UrdfFileCfg.JointDriveCfg(
|
||||
drive_type="force",
|
||||
target_type="position",
|
||||
gains=sim_utils.UrdfFileCfg.JointDriveCfg.PDGainsCfg(stiffness=2.0, damping=0.08),
|
||||
),
|
||||
rigid_props=sim_utils.RigidBodyPropertiesCfg(
|
||||
disable_gravity=False, # 不启用重力。
|
||||
max_linear_velocity=100.0,
|
||||
max_angular_velocity=100.0,
|
||||
max_depenetration_velocity=5.0,
|
||||
),
|
||||
articulation_props=sim_utils.ArticulationRootPropertiesCfg(
|
||||
enabled_self_collisions=False, # # 启用自碰撞检测。
|
||||
solver_position_iteration_count=8,
|
||||
solver_velocity_iteration_count=2,
|
||||
),
|
||||
),
|
||||
init_state=ArticulationCfg.InitialStateCfg( # 初始状态配置。单位: 弧度
|
||||
pos=(0.0, 0.0, 0.18),
|
||||
joint_pos={"jlf0_link": 0.0, "jlf1_link": 0.0, "jlf2_link": 0.0, "jlf3_link": 0.0,
|
||||
"jrf0_link": 0.0, "jrf1_link": 0.0, "jrf2_link": 0.0, "jrf3_link": 0.0},
|
||||
joint_vel={".*": 0.0},
|
||||
),
|
||||
actuators={ # 动力配置。
|
||||
"legs": ImplicitActuatorCfg(
|
||||
joint_names_expr=JOINT_NAMES, # 控制所有腿的关节。
|
||||
effort_limit_sim=0.08, # 力矩限制。单位:牛顿米。
|
||||
stiffness=2.0, # 刚度。单位:牛顿/米。
|
||||
damping=0.08, # 阻尼。单位:牛顿秒/米。
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
##
|
||||
# Physics presets
|
||||
##
|
||||
|
||||
|
||||
@configclass
|
||||
class RoughPhysicsCfg(PresetCfg):
|
||||
"""Shared physics preset for all rough-terrain locomotion envs."""
|
||||
|
||||
default = PhysxCfg(gpu_max_rigid_patch_count=10 * 2**15)
|
||||
newton_mjwarp = NewtonCfg(
|
||||
solver_cfg=MJWarpSolverCfg(
|
||||
njmax=200,
|
||||
nconmax=100,
|
||||
cone="pyramidal",
|
||||
impratio=1.0,
|
||||
integrator="implicitfast",
|
||||
use_mujoco_contacts=False,
|
||||
),
|
||||
collision_cfg=NewtonCollisionPipelineCfg(max_triangle_pairs=2_500_000),
|
||||
num_substeps=1,
|
||||
debug_mode=False,
|
||||
# 1 cm shape margin is the single most important Newton setting for rough
|
||||
# terrain — without it, non-Anymal-D robots fail to learn stable contact
|
||||
# on triangle-mesh terrain. See isaaclab_newton 0.5.22 changelog.
|
||||
default_shape_cfg=NewtonShapeCfg(margin=0.01),
|
||||
)
|
||||
physx = default
|
||||
|
||||
|
||||
##
|
||||
# Scene definition
|
||||
##
|
||||
|
||||
|
||||
@configclass
|
||||
class VelocityEnvContactSensorCfg(PresetCfg):
|
||||
default = PhysXContactSensorCfg(
|
||||
prim_path="{ENV_REGEX_NS}/Robot/.*",
|
||||
history_length=3,
|
||||
track_air_time=True)
|
||||
newton_mjwarp = NewtonContactSensorCfg(prim_path="{ENV_REGEX_NS}/Robot/.*", history_length=3, track_air_time=True)
|
||||
physx = default
|
||||
ovphysx = OvPhysXContactSensorCfg(prim_path="{ENV_REGEX_NS}/Robot/.*", history_length=3, track_air_time=True)
|
||||
|
||||
|
||||
@configclass
|
||||
class MySceneCfg(InteractiveSceneCfg):
|
||||
head_camera = TiledCameraCfg(
|
||||
prim_path="{ENV_REGEX_NS}/Robot/head_link/camera", # 摄像头在场景中的路径
|
||||
update_period=0.1, # 数据更新周期 (秒)
|
||||
height=480, # 图像高度
|
||||
width=640, # 图像宽度
|
||||
data_types=["rgb"], # 获取RGB图像
|
||||
spawn=PinholeCameraCfg( # 相机内参配置
|
||||
focal_length=24.0, # 焦距
|
||||
focus_distance=400.0, # 对焦距离
|
||||
horizontal_aperture=20.955, # 水平孔径
|
||||
clipping_range=(0.1, 1.0e5), # 裁剪范围
|
||||
),
|
||||
offset=CameraCfg.OffsetCfg( # 摄像头相对于挂载点的偏移
|
||||
pos=(0.0, 0.0, 0.09), # 位置偏移 (x, y, z)
|
||||
rot=(1.0, 0.0, 0.0, 0.0), # 旋转 (w, x, y, z)
|
||||
convention="world", # 坐标约定
|
||||
),
|
||||
)
|
||||
|
||||
"""Configuration for the terrain scene with a legged robot."""
|
||||
|
||||
# ground terrain
|
||||
terrain = TerrainImporterCfg(
|
||||
prim_path="/World/ground",
|
||||
terrain_type="plane",
|
||||
collision_group=-1,
|
||||
physics_material=sim_utils.RigidBodyMaterialCfg(
|
||||
friction_combine_mode="multiply",
|
||||
restitution_combine_mode="multiply",
|
||||
static_friction=1.0,
|
||||
dynamic_friction=1.0,
|
||||
),
|
||||
visual_material=sim_utils.MdlFileCfg(
|
||||
mdl_path=f"{ISAACLAB_NUCLEUS_DIR}/Materials/TilesMarbleSpiderWhiteBrickBondHoned/TilesMarbleSpiderWhiteBrickBondHoned.mdl",
|
||||
project_uvw=True,
|
||||
texture_scale=(0.25, 0.25),
|
||||
),
|
||||
debug_vis=False,
|
||||
)
|
||||
# robots
|
||||
robot: ArticulationCfg = TOFOOTBOT_CFG.replace(prim_path="{ENV_REGEX_NS}/Robot")
|
||||
# sensors
|
||||
#height_scanner = None
|
||||
height_scanner = RayCasterCfg(
|
||||
prim_path="{ENV_REGEX_NS}/Robot/head_link",
|
||||
offset=RayCasterCfg.OffsetCfg(pos=(0.0, 0.0, 20.0)),
|
||||
ray_alignment="yaw",
|
||||
pattern_cfg=patterns.GridPatternCfg(resolution=0.1, size=[0.40, 0.25]),
|
||||
debug_vis=False,
|
||||
mesh_prim_paths=["/World/ground"],
|
||||
)
|
||||
contact_forces = VelocityEnvContactSensorCfg()
|
||||
|
||||
# lights
|
||||
sky_light = AssetBaseCfg(
|
||||
prim_path="/World/skyLight",
|
||||
spawn=sim_utils.DomeLightCfg(
|
||||
intensity=750.0,
|
||||
texture_file=f"{ISAAC_NUCLEUS_DIR}/Materials/Textures/Skies/PolyHaven/kloofendal_43d_clear_puresky_4k.hdr",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
##
|
||||
# MDP settings
|
||||
##
|
||||
|
||||
|
||||
@configclass
|
||||
class CommandsCfg:
|
||||
"""Command specifications for the MDP."""
|
||||
|
||||
base_velocity = mdp.UniformVelocityCommandCfg(
|
||||
asset_name="robot",
|
||||
resampling_time_range=(10.0, 10.0),
|
||||
rel_standing_envs=0.02,
|
||||
rel_heading_envs=1.0,
|
||||
heading_command=True,
|
||||
heading_control_stiffness=0.5,
|
||||
debug_vis=True,
|
||||
ranges=mdp.UniformVelocityCommandCfg.Ranges(
|
||||
lin_vel_x=(-0.5, 0.5), lin_vel_y=(-0.3, 0.3), ang_vel_z=(-0.5, 0.5), heading=(-math.pi, math.pi)
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@configclass
|
||||
class ActionsCfg:
|
||||
"""Action specifications for the MDP."""
|
||||
|
||||
joint_pos = mdp.JointPositionActionCfg(asset_name="robot", joint_names=[".*"], scale=0.5, use_default_offset=True)
|
||||
|
||||
|
||||
def camera_rgb(env, sensor_cfg: SceneEntityCfg):
|
||||
"""Return RGB images in the channel-first format expected by CNN policies."""
|
||||
img = env.scene.sensors[sensor_cfg.name].data.output["rgb"] # shape (num_envs, H, W, 3)
|
||||
return img.permute(0, 3, 1, 2).float()
|
||||
|
||||
@configclass
|
||||
class ObservationsCfg:
|
||||
"""Observation specifications for the MDP."""
|
||||
|
||||
@configclass
|
||||
class PolicyCfg(ObsGroup):
|
||||
"""Observations for policy group."""
|
||||
#添加摄像头观测
|
||||
# observation terms (order preserved)
|
||||
base_lin_vel = ObsTerm(func=mdp.base_lin_vel, noise=Unoise(n_min=-0.1, n_max=0.1)) # 添加线速度观测
|
||||
base_ang_vel = ObsTerm(func=mdp.base_ang_vel, noise=Unoise(n_min=-0.2, n_max=0.2)) # 添加角速度观测
|
||||
projected_gravity = ObsTerm( # 添加重力方向观测
|
||||
func=mdp.projected_gravity,
|
||||
noise=Unoise(n_min=-0.05, n_max=0.05),
|
||||
)
|
||||
velocity_commands = ObsTerm(func=mdp.generated_commands, params={"command_name": "base_velocity"}) # 添加速度命令观测
|
||||
joint_pos = ObsTerm(func=mdp.joint_pos_rel, noise=Unoise(n_min=-0.01, n_max=0.01)) # 添加关节位置观测
|
||||
joint_vel = ObsTerm(func=mdp.joint_vel_rel, noise=Unoise(n_min=-1.5, n_max=1.5)) # 添加关节速度观测
|
||||
actions = ObsTerm(func=mdp.last_action) # 添加动作观测
|
||||
''' height_scan = ObsTerm(
|
||||
func=mdp.height_scan,
|
||||
params={"sensor_cfg": SceneEntityCfg("height_scanner")},
|
||||
noise=Unoise(n_min=-0.1, n_max=0.1),
|
||||
clip=(-1.0, 1.0),
|
||||
)
|
||||
'''
|
||||
def __post_init__(self):
|
||||
self.enable_corruption = True # 添加噪声
|
||||
self.concatenate_terms = True # 添加观测
|
||||
|
||||
@configclass
|
||||
class CameraCfg(ObsGroup):
|
||||
"""添加摄像头观测"""
|
||||
|
||||
camera_rgb = ObsTerm(
|
||||
func=camera_rgb,
|
||||
params={"sensor_cfg": SceneEntityCfg("head_camera")},
|
||||
noise=Unoise(n_min=-0.1, n_max=0.1),
|
||||
clip=(-1.0, 1.0),
|
||||
)
|
||||
|
||||
def __post_init__(self):
|
||||
self.enable_corruption = True
|
||||
self.concatenate_terms = True
|
||||
|
||||
# observation groups
|
||||
policy: PolicyCfg = PolicyCfg()
|
||||
camera: CameraCfg = CameraCfg()
|
||||
|
||||
|
||||
@configclass
|
||||
class EventsCfg:
|
||||
"""Configuration for events."""
|
||||
|
||||
# startup
|
||||
physics_material = EventTerm(
|
||||
func=mdp.randomize_rigid_body_material,
|
||||
mode="startup",
|
||||
params={
|
||||
"asset_cfg": SceneEntityCfg("robot", body_names=".*"),
|
||||
"static_friction_range": (0.8, 0.8),
|
||||
"dynamic_friction_range": (0.6, 0.6),
|
||||
"restitution_range": (0.0, 0.0),
|
||||
"num_buckets": 64,
|
||||
},
|
||||
)
|
||||
|
||||
add_base_mass = EventTerm(
|
||||
func=mdp.randomize_rigid_body_mass,
|
||||
mode="startup",
|
||||
params={
|
||||
"asset_cfg": SceneEntityCfg("robot", body_names="head_link"),
|
||||
# Multiplicative ±25% log-uniform. Scale-invariant across robot sizes
|
||||
# (no per-robot kg overrides needed) with geometric mean 1.0 and
|
||||
# symmetric inverse perturbation (acceleration symmetric around nominal).
|
||||
"mass_distribution_params": (1 / 1.25, 1.25),
|
||||
"operation": "scale",
|
||||
"distribution": "log_uniform",
|
||||
},
|
||||
)
|
||||
|
||||
base_com = preset(
|
||||
default=EventTerm(
|
||||
func=mdp.randomize_rigid_body_com,
|
||||
mode="startup",
|
||||
params={
|
||||
"asset_cfg": SceneEntityCfg("robot", body_names="head_link"),
|
||||
"com_range": {"x": (-0.05, 0.05), "y": (-0.05, 0.05), "z": (-0.01, 0.01)},
|
||||
},
|
||||
),
|
||||
newton_mjwarp=None,
|
||||
)
|
||||
|
||||
# reset
|
||||
base_external_force_torque = EventTerm(
|
||||
func=mdp.apply_external_force_torque,
|
||||
mode="reset",
|
||||
params={
|
||||
"asset_cfg": SceneEntityCfg("robot", body_names="head_link"),
|
||||
"force_range": (0.0, 0.0),
|
||||
"torque_range": (-0.0, 0.0),
|
||||
},
|
||||
)
|
||||
|
||||
reset_base = EventTerm(
|
||||
func=mdp.reset_root_state_uniform,
|
||||
mode="reset",
|
||||
params={
|
||||
"pose_range": {"x": (-0, 0), "y": (-0, 0), "yaw": (-3.14, 3.14)},
|
||||
"velocity_range": {
|
||||
"x": (-0.0, 0.0),
|
||||
"y": (-0.0, 0.0),
|
||||
"z": (-0.0, 0.0),
|
||||
"roll": (-0.0, 0.0),
|
||||
"pitch": (-0.0, 0.0),
|
||||
"yaw": (-0.0, 0.0),
|
||||
},
|
||||
},
|
||||
)
|
||||
|
||||
reset_robot_joints = EventTerm(
|
||||
func=mdp.reset_joints_by_scale,
|
||||
mode="reset",
|
||||
params={
|
||||
"position_range": (0.5, 1.5),
|
||||
"velocity_range": (0.0, 0.0),
|
||||
},
|
||||
)
|
||||
|
||||
# interval
|
||||
push_robot = EventTerm(
|
||||
func=mdp.push_by_setting_velocity,
|
||||
mode="interval",
|
||||
interval_range_s=(10.0, 15.0),
|
||||
params={"velocity_range": {"x": (-0.5, 0.5), "y": (-0.5, 0.5)}},
|
||||
)
|
||||
|
||||
|
||||
def feet_air_time_alt(env):
|
||||
"""替代奖励:基于足端高度估计空中时间,鼓励足部腾空。"""
|
||||
# 获取左右足端位置(世界坐标)
|
||||
foot_l_pos = env.scene["robot"].data.body_pos_w[:, env.scene["robot"].body_names.index("lf3_link")]
|
||||
foot_r_pos = env.scene["robot"].data.body_pos_w[:, env.scene["robot"].body_names.index("rf3_link")]
|
||||
foot_z = torch.stack([foot_l_pos[:, 2], foot_r_pos[:, 2]], dim=1) # (num_envs, 2)
|
||||
|
||||
# 触地判断(高度低于阈值)
|
||||
contact_threshold = 0.02 # 可根据机器人尺寸调整
|
||||
in_air = foot_z > contact_threshold # True表示在空中
|
||||
|
||||
# 计算每只脚累计空中步数(可在环境状态中存储历史)
|
||||
# 这里简化:给予即时奖励:空中高度*系数
|
||||
#air_time_reward = torch.sum(foot_z * in_air.float(), dim=1) * 1 # 系数可调
|
||||
air_time_reward = torch.sum(in_air.float(), dim=1) * 1 # 每只脚在空中给予奖励
|
||||
return air_time_reward
|
||||
|
||||
@configclass
|
||||
class RewardsCfg:
|
||||
"""Reward terms for the MDP."""
|
||||
|
||||
# -- task
|
||||
track_lin_vel_xy_exp = RewTerm(
|
||||
func=mdp.track_lin_vel_xy_exp, weight=7.0, params={"command_name": "base_velocity", "std": math.sqrt(0.25)}
|
||||
)#水平跟随
|
||||
track_ang_vel_z_exp = RewTerm(
|
||||
func=mdp.track_ang_vel_z_exp, weight=2.0, params={"command_name": "base_velocity", "std": math.sqrt(0.25)}
|
||||
)#偏航角跟随
|
||||
# -- penalties
|
||||
lin_vel_z_l2 = RewTerm(func=mdp.lin_vel_z_l2, weight=-1.0)#垂直速度分量
|
||||
ang_vel_xy_l2 = RewTerm(func=mdp.ang_vel_xy_l2, weight=-1.0) #机身翻滚
|
||||
dof_torques_l2 = RewTerm(func=mdp.joint_torques_l2, weight=-1.0e-5)#关节力矩平方和
|
||||
dof_acc_l2 = RewTerm(func=mdp.joint_acc_l2, weight=-2.5e-7)#关节加速度平方和
|
||||
action_rate_l2 = RewTerm(func=mdp.action_rate_l2, weight=-1.0e-3)#惩罚相邻动作之间的变化量平方
|
||||
alive = RewTerm( #固定时间惩罚
|
||||
func=mdp.is_alive, # 该函数通常返回1(若机器人存活)
|
||||
weight=-0.25,
|
||||
)
|
||||
fall_penalty = RewTerm( #摔倒惩罚
|
||||
func=mdp.is_terminated_term,
|
||||
weight=-100.0,
|
||||
params={"term_keys": "base_contact"},
|
||||
)
|
||||
|
||||
feet_air_time_alt = RewTerm(func=feet_air_time_alt, weight=0.1) # 足端空中时间奖励
|
||||
|
||||
'''feet_air_time = RewTerm(
|
||||
func=mdp.feet_air_time,
|
||||
weight=0.125,
|
||||
params={
|
||||
#"sensor_cfg": SceneEntityCfg("contact_forces", body_names=".*3_link"),
|
||||
"sensor_cfg": SceneEntityCfg("robot", body_names=".*3_link"),
|
||||
"command_name": "base_velocity",
|
||||
"threshold": 0.5,
|
||||
},
|
||||
)
|
||||
undesired_contacts = RewTerm(
|
||||
func=mdp.undesired_contacts,
|
||||
weight=-1.0,
|
||||
params={
|
||||
#"sensor_cfg": SceneEntityCfg("contact_forces", body_names=".*0_link"),
|
||||
"sensor_cfg": SceneEntityCfg("robot", body_names=".*0_link"),
|
||||
"threshold": 1.0
|
||||
},
|
||||
)'''
|
||||
|
||||
# -- optional penalties
|
||||
flat_orientation_l2 = RewTerm(func=mdp.flat_orientation_l2, weight=-1.5) #惩罚倾斜角度
|
||||
dof_pos_limits = RewTerm(func=mdp.joint_pos_limits, weight=0.0) #关节位置限制惩罚
|
||||
|
||||
@configclass
|
||||
class TerminationsCfg:
|
||||
"""Termination terms for the MDP."""
|
||||
|
||||
time_out = DoneTerm(func=mdp.time_out, time_out=True)
|
||||
base_contact = DoneTerm(
|
||||
func=mdp.illegal_contact,
|
||||
params={"sensor_cfg": SceneEntityCfg("contact_forces", body_names="head_link"), "threshold": 1.0},
|
||||
#params={"asset_cfg": SceneEntityCfg("robot", body_names=["head_link", "lf0_link", "rf0_link"]), "threshold": 1.0},
|
||||
)
|
||||
#机器人Z轴与世界Z轴夹角超90度则终止
|
||||
'''upside_down = DoneTerm(
|
||||
func=mdp.upside_down,
|
||||
params={"asset_cfg": SceneEntityCfg("robot"), "threshold": 0.0},)'''
|
||||
|
||||
|
||||
@configclass
|
||||
class CurriculumCfg:
|
||||
"""Curriculum terms for the MDP."""
|
||||
|
||||
terrain_levels = CurrTerm(func=mdp.terrain_levels_vel)
|
||||
|
||||
|
||||
##
|
||||
# Environment configuration
|
||||
##
|
||||
|
||||
|
||||
@configclass
|
||||
class TwofootbotEnvCfg(ManagerBasedRLEnvCfg):
|
||||
"""Configuration for the locomotion velocity-tracking environment."""
|
||||
|
||||
# Simulation settings — shared physics preset (PhysX + MJWarp) for all rough-terrain envs
|
||||
sim: SimulationCfg = SimulationCfg(physics=RoughPhysicsCfg())
|
||||
# Scene settings
|
||||
scene: MySceneCfg = MySceneCfg(num_envs=100, env_spacing=0.5)
|
||||
# Basic settings
|
||||
observations: ObservationsCfg = ObservationsCfg()
|
||||
actions: ActionsCfg = ActionsCfg()
|
||||
commands: CommandsCfg = CommandsCfg()
|
||||
# MDP settings
|
||||
rewards: RewardsCfg = RewardsCfg()
|
||||
terminations: TerminationsCfg = TerminationsCfg()
|
||||
events: EventsCfg = EventsCfg()
|
||||
curriculum: CurriculumCfg = CurriculumCfg()
|
||||
|
||||
def __post_init__(self):
|
||||
"""Post initialization."""
|
||||
# general settings
|
||||
self.decimation = 4
|
||||
self.episode_length_s = 20.0 #time_out = 20s
|
||||
# simulation settings
|
||||
self.sim.dt = 0.005
|
||||
self.sim.render_interval = self.decimation
|
||||
self.sim.physics_material = self.scene.terrain.physics_material
|
||||
self.curriculum.terrain_levels = None
|
||||
# update sensor update periods
|
||||
# we tick all the sensors based on the smallest update period (physics update period)
|
||||
if self.scene.height_scanner is not None:
|
||||
self.scene.height_scanner.update_period = self.decimation * self.sim.dt
|
||||
if self.scene.contact_forces is not None:
|
||||
self.scene.contact_forces.update_period = self.sim.dt
|
||||
|
||||
# check if terrain levels curriculum is enabled - if so, enable curriculum for terrain generator
|
||||
# this generates terrains with increasing difficulty and is useful for training
|
||||
if getattr(self.curriculum, "terrain_levels", None) is not None:
|
||||
if self.scene.terrain.terrain_generator is not None:
|
||||
self.scene.terrain.terrain_generator.curriculum = True
|
||||
else:
|
||||
if self.scene.terrain.terrain_generator is not None:
|
||||
self.scene.terrain.terrain_generator.curriculum = False
|
||||
|
|
|
|||
Loading…
Reference in New Issue