Skip to content

Commit

Permalink
enable samplerobot gazebo simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoki-Hiraoka committed Apr 16, 2020
1 parent c077111 commit 3f8ad39
Show file tree
Hide file tree
Showing 6 changed files with 204 additions and 31 deletions.
61 changes: 31 additions & 30 deletions hrpsys_gazebo_tutorials/config/SampleRobot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
hrpsys_gazebo_configuration:
### velocity feedback for joint control, use parameter gains/joint_name/p_v
use_velocity_feedback: true
use_velocity_feedback: false
use_joint_effort: true
# iob_rate: 200
### loose synchronization default true
Expand Down Expand Up @@ -75,35 +75,35 @@ hrpsys_gazebo_configuration:
# 28 - CHEST
## joint gain settings
gains:
LLEG_HIP_R: {p: 12000.0, d: 4.0, i: 0.0, vp: 6.0, i_clamp: 0.0, p_v: 250.0}
LLEG_HIP_P: {p: 24000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_HIP_Y: {p: 4000.0, d: 4.0, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
LLEG_KNEE: {p: 36000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_ANKLE_P: {p: 18000.0, d: 3.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_ANKLE_R: {p: 6000.0, d: 2.0, i: 0.0, vp: 4.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_R: {p: 12000.0, d: 4.0, i: 0.0, vp: 6.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_P: {p: 24000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_Y: {p: 4000.0, d: 4.0, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
RLEG_KNEE: {p: 36000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_ANKLE_P: {p: 18000.0, d: 3.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_ANKLE_R: {p: 6000.0, d: 2.0, i: 0.0, vp: 4.0, i_clamp: 0.0, p_v: 250.0}
WAIST_P: {p: 8000.0, d: 4.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
WAIST_R: {p: 8000.0, d: 4.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
CHEST: {p: 6000.0, d: 2.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LARM_SHOULDER_P: {p: 1200.0, d: 1.0, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
LARM_SHOULDER_R: {p: 500.0, d: 0.5, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 120.0}
LARM_SHOULDER_Y: {p: 200.0, d: 0.3, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_ELBOW: {p: 1000.0, d: 1.4, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
LARM_WRIST_Y: {p: 200.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_WRIST_P: {p: 300.0, d: 0.2, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_WRIST_R: {p: 20.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_SHOULDER_P: {p: 1200.0, d: 1.0, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
RARM_SHOULDER_R: {p: 500.0, d: 0.5, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 120.0}
RARM_SHOULDER_Y: {p: 200.0, d: 0.3, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_ELBOW: {p: 1000.0, d: 1.4, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
RARM_WRIST_Y: {p: 200.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_WRIST_P: {p: 300.0, d: 0.2, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_WRIST_R: {p: 20.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LLEG_HIP_R: {p: 6000.0, d: 0.1, i: 0.0, vp: 6.0, i_clamp: 0.0, p_v: 250.0}
LLEG_HIP_P: {p: 6000.0, d: 0.15, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_HIP_Y: {p: 2000.0, d: 0.1, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
LLEG_KNEE: {p: 9000.0, d: 0.15, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
LLEG_ANKLE_P: {p: 4500.0, d: 0.075, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_ANKLE_R: {p: 3000.0, d: 0.05, i: 0.0, vp: 4.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_R: {p: 6000.0, d: 0.1, i: 0.0, vp: 6.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_P: {p: 6000.0, d: 0.05, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_Y: {p: 2000.0, d: 0.1, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
RLEG_KNEE: {p: 9000.0, d: 0.15, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
RLEG_ANKLE_P: {p: 4500.0, d: 0.075, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_ANKLE_R: {p: 3000.0, d: 0.05, i: 0.0, vp: 4.0, i_clamp: 0.0, p_v: 250.0}
WAIST_P: {p: 8000.0, d: 0.1, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
WAIST_R: {p: 8000.0, d: 0.1, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
CHEST: {p: 6000.0, d: 0.05, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LARM_SHOULDER_P: {p: 1200.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
LARM_SHOULDER_R: {p: 500.0, d: 0.05, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 120.0}
LARM_SHOULDER_Y: {p: 200.0, d: 0.03, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_ELBOW: {p: 1000.0, d: 0.14, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
LARM_WRIST_Y: {p: 200.0, d: 0.01, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_WRIST_P: {p: 300.0, d: 0.02, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_WRIST_R: {p: 20.0, d: 0.01, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_SHOULDER_P: {p: 1200.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
RARM_SHOULDER_R: {p: 500.0, d: 0.05, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 120.0}
RARM_SHOULDER_Y: {p: 200.0, d: 0.03, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_ELBOW: {p: 1000.0, d: 0.14, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
RARM_WRIST_Y: {p: 200.0, d: 0.01, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_WRIST_P: {p: 300.0, d: 0.02, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_WRIST_R: {p: 20.0, d: 0.01, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
## force sensor settings
## list of force sensorname
force_torque_sensors:
Expand All @@ -121,6 +121,7 @@ hrpsys_gazebo_configuration:
## IMU sensor settings
## configuration of IMU sensor
## key of imu_sensors_config should be a member of imu_sensors
## pose of IMU sensor should be written in URDF
imu_sensors:
- imu_sensor0
imu_sensors_config:
Expand Down
127 changes: 127 additions & 0 deletions hrpsys_gazebo_tutorials/config/SampleRobot_indigo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
hrpsys_gazebo_configuration:
### velocity feedback for joint control, use parameter gains/joint_name/p_v
use_velocity_feedback: true
use_joint_effort: true
# iob_rate: 200
### loose synchronization default true
# use_loose_synchronized: false
### synchronized hrpsys and gazebo
# use_synchronized_command: false
# iob_substeps: 5
### name of robot (using for namespace)
robotname: SampleRobot
### joint_id (order) conversion from gazebo to hrpsys, joint_id_list[gazebo_id] := hrpsys_id
joint_id_list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28]
### joints : list used in gazebo, sizeof(joint_id_list) == sizeof(joints)
joints:
- RLEG_HIP_R
- RLEG_HIP_P
- RLEG_HIP_Y
- RLEG_KNEE
- RLEG_ANKLE_P
- RLEG_ANKLE_R
- RARM_SHOULDER_P
- RARM_SHOULDER_R
- RARM_SHOULDER_Y
- RARM_ELBOW
- RARM_WRIST_Y
- RARM_WRIST_P
- RARM_WRIST_R
- LLEG_HIP_R
- LLEG_HIP_P
- LLEG_HIP_Y
- LLEG_KNEE
- LLEG_ANKLE_P
- LLEG_ANKLE_R
- LARM_SHOULDER_P
- LARM_SHOULDER_R
- LARM_SHOULDER_Y
- LARM_ELBOW
- LARM_WRIST_Y
- LARM_WRIST_P
- LARM_WRIST_R
- WAIST_P
- WAIST_R
- CHEST
## comment for joint index
# 0 - RLEG_HIP_R
# 1 - RLEG_HIP_P
# 2 - RLEG_HIP_Y
# 3 - RLEG_KNEE
# 4 - RLEG_ANKLE_P
# 5 - RLEG_ANKLE_R
# 6 - RARM_SHOULDER_P
# 7 - RARM_SHOULDER_R
# 8 - RARM_SHOULDER_Y
# 9 - RARM_ELBOW
# 10 - RARM_WRIST_Y
# 11 - RARM_WRIST_P
# 12 - RARM_WRIST_R
# 13 - LLEG_HIP_R
# 14 - LLEG_HIP_P
# 15 - LLEG_HIP_Y
# 16 - LLEG_KNEE
# 17 - LLEG_ANKLE_P
# 18 - LLEG_ANKLE_R
# 19 - LARM_SHOULDER_P
# 20 - LARM_SHOULDER_R
# 21 - LARM_SHOULDER_Y
# 22 - LARM_ELBOW
# 23 - LARM_WRIST_Y
# 24 - LARM_WRIST_P
# 25 - LARM_WRIST_R
# 26 - WAIST_P
# 27 - WAIST_R
# 28 - CHEST
## joint gain settings
gains:
LLEG_HIP_R: {p: 12000.0, d: 4.0, i: 0.0, vp: 6.0, i_clamp: 0.0, p_v: 250.0}
LLEG_HIP_P: {p: 24000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_HIP_Y: {p: 4000.0, d: 4.0, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
LLEG_KNEE: {p: 36000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_ANKLE_P: {p: 18000.0, d: 3.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LLEG_ANKLE_R: {p: 6000.0, d: 2.0, i: 0.0, vp: 4.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_R: {p: 12000.0, d: 4.0, i: 0.0, vp: 6.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_P: {p: 24000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_HIP_Y: {p: 4000.0, d: 4.0, i: 0.0, vp: 1.0, i_clamp: 0.0, p_v: 250.0}
RLEG_KNEE: {p: 36000.0, d: 6.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_ANKLE_P: {p: 18000.0, d: 3.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
RLEG_ANKLE_R: {p: 6000.0, d: 2.0, i: 0.0, vp: 4.0, i_clamp: 0.0, p_v: 250.0}
WAIST_P: {p: 8000.0, d: 4.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
WAIST_R: {p: 8000.0, d: 4.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
CHEST: {p: 6000.0, d: 2.0, i: 0.0, vp: 20.0, i_clamp: 0.0, p_v: 250.0}
LARM_SHOULDER_P: {p: 1200.0, d: 1.0, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
LARM_SHOULDER_R: {p: 500.0, d: 0.5, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 120.0}
LARM_SHOULDER_Y: {p: 200.0, d: 0.3, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_ELBOW: {p: 1000.0, d: 1.4, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
LARM_WRIST_Y: {p: 200.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_WRIST_P: {p: 300.0, d: 0.2, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
LARM_WRIST_R: {p: 20.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_SHOULDER_P: {p: 1200.0, d: 1.0, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
RARM_SHOULDER_R: {p: 500.0, d: 0.5, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 120.0}
RARM_SHOULDER_Y: {p: 200.0, d: 0.3, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_ELBOW: {p: 1000.0, d: 1.4, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 160.0}
RARM_WRIST_Y: {p: 200.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_WRIST_P: {p: 300.0, d: 0.2, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
RARM_WRIST_R: {p: 20.0, d: 0.1, i: 0.0, vp: 0.0, i_clamp: 0.0, p_v: 100.0}
## force sensor settings
## list of force sensorname
force_torque_sensors:
- lfsensor
- rfsensor
- lhsensor
- rhsensor
## configuration of force sensor
## key of force_torque_sensors_config should be a member of force_torque_sensors
force_torque_sensors_config:
lfsensor: {joint_name: 'LLEG_ANKLE_R', frame_id: 'LLEG_LINK6', translation: [0, 0, 0], rotation: [1, 0, 0, 0]}
rfsensor: {joint_name: 'RLEG_ANKLE_R', frame_id: 'RLEG_LINK6', translation: [0, 0, 0], rotation: [1, 0, 0, 0]}
lhsensor: {joint_name: 'LARM_WRIST_R', frame_id: 'LARM_LINK7'}
rhsensor: {joint_name: 'RARM_WRIST_R', frame_id: 'RARM_LINK7'}
## IMU sensor settings
## configuration of IMU sensor
## key of imu_sensors_config should be a member of imu_sensors
imu_sensors:
- imu_sensor0
imu_sensors_config:
imu_sensor0: {ros_name: 'sample_imu_sensor', link_name: 'WAIST_LINK0', frame_id: 'WAIST_LINK0'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<launch>
<arg name="gzname" default="gazebo"/>
<arg name="WORLD" default="$(find hrpsys_gazebo_general)/worlds/empty.world"/>
<arg name="PAUSED" default="false"/>
<arg name="SYNCHRONIZED" default="false" />

<!-- initial robot pose -->
<arg name="MODEL_TRANSLATE_X" default="0.0" />
<arg name="MODEL_TRANSLATE_Y" default="0.0" />
<arg name="MODEL_TRANSLATE_Z" default="0.73" />
<arg name="MODEL_ROTATE_R" default="0.0" />
<arg name="MODEL_ROTATE_P" default="0.0" />
<arg name="MODEL_ROTATE_Y" default="0.0" />

<include file="$(find hrpsys_gazebo_general)/launch/gazebo_robot_no_controllers.launch">
<arg name="ROBOT_TYPE" value="SampleRobot" />
<arg name="WORLD" value="$(arg WORLD)" />
<arg name="HRPSYS_GAZEBO_CONFIG" default="$(find hrpsys_gazebo_tutorials)/config/SampleRobot_indigo.yaml" />
<arg name="ROBOT_MODEL" default="$(find hrpsys_gazebo_tutorials)/robot_models/SampleRobot/SampleRobot.urdf.xacro" />

<arg name="PAUSED" value="$(arg PAUSED)"/>
<arg name="SYNCHRONIZED" value="$(arg SYNCHRONIZED)" />
<arg name="USE_INSTANCE_NAME" value="true" />
<arg name="gzname" value="$(arg gzname)" />

<arg name="MODEL_TRANSLATE_X" value="$(arg MODEL_TRANSLATE_X)" />
<arg name="MODEL_TRANSLATE_Y" value="$(arg MODEL_TRANSLATE_Y)" />
<arg name="MODEL_TRANSLATE_Z" value="$(arg MODEL_TRANSLATE_Z)" />
<arg name="MODEL_ROTATE_R" value="$(arg MODEL_ROTATE_R)" />
<arg name="MODEL_ROTATE_P" value="$(arg MODEL_ROTATE_P)" />
<arg name="MODEL_ROTATE_Y" value="$(arg MODEL_ROTATE_Y)" />
</include>
</launch>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
<arg name="CONF_DIR" value="$(find hrpsys_ros_bridge_tutorials)/models" />
<arg name="USE_INSTANCE_NAME" value="true" />
<arg name="SYNCHRONIZED" value="$(arg SYNCHRONIZED)" />
<arg name="HRPSYS_PY_ARGS" value="--use-unstable-rtc" />
<arg name="HRPSYS_PY_PKG" value="hrpsys_ros_bridge_tutorials"/>
<arg name="HRPSYS_PY_NAME" default="samplerobot_hrpsys_config.py"/>
<arg name="KINEMATICS_MODE" value="$(arg KINEMATICS_MODE)"/>
<arg name="BASE_LINK" value="WAIST_LINK0" />
</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
</accel>
</noise>
</imu>
<pose>0 0 0 1.5708 0 3.14159</pose>
</sensor>
</gazebo>
<!-- add force sensor -->
Expand Down
10 changes: 10 additions & 0 deletions hrpsys_ros_bridge_tutorials/models/samplerobot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,13 @@ replace_xmls:
attribute_name: type
attribute_value: continuous
replaced_attribute_value: revolute
- match_rule:
tag: dynamics
attribute_name: friction
attribute_value: 0
replaced_attribute_value: 1
- match_rule:
tag: dynamics
attribute_name: damping
attribute_value: 0.2
replaced_attribute_value: 1

0 comments on commit 3f8ad39

Please sign in to comment.