Skip to content

Commit 6a00b2a

Browse files
added new reward function - not working
1 parent 8676010 commit 6a00b2a

File tree

3 files changed

+216
-115
lines changed

3 files changed

+216
-115
lines changed

isaacgymenvs/cfg/task/Atlas.yaml

Lines changed: 76 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
# used to create the object
22
name: Atlas
33

4-
physics_engine: ${..physics_engine}
4+
physics_engine: 'physx'
55

66
env:
7-
numEnvs: ${resolve_default:16,${...num_envs}}
7+
numEnvs: ${resolve_default:512,${...num_envs}}
8+
numObservations: 242
9+
numActions: 30
810
envSpacing: 4. # [m]
11+
enableDebugVis: False
912

10-
clipObservations: 5.0
11-
clipActions: 1.0
12-
13-
plane:
13+
terrain:
14+
terrainType: plane # none, plane, or trimesh
1415
staticFriction: 1.0 # [-]
1516
dynamicFriction: 1.0 # [-]
1617
restitution: 0. # [-]
18+
# rough terrain only:
19+
curriculum: true
20+
maxInitMapLevel: 0
21+
mapLength: 8.
22+
mapWidth: 8.
23+
numLevels: 10
24+
numTerrains: 20
25+
# terrain types: [smooth slope, rough slope, stairs up, stairs down, discrete]
26+
terrainProportions: [0.1, 0.1, 0.35, 0.25, 0.2]
27+
# tri mesh only:
28+
slopeTreshold: 0.5
1729

1830
baseInitState:
1931
pos: [0.0, 0.0, 0.95] # x,y,z [m]
@@ -22,6 +34,7 @@ env:
2234
vAngular: [0.0, 0.0, 0.0] # x,y,z [rad/s]
2335

2436
randomCommandVelocityRanges:
37+
# train
2538
linear_x: [-1., 1.] # min max [m/s]
2639
linear_y: [0., 0.] # min max [m/s]
2740
yaw: [-1.57, 1.57] # min max [rad/s]
@@ -30,47 +43,85 @@ env:
3043
# PD Drive parameters:
3144
stiffness: 85.0 # [N*m/rad]
3245
damping: 4.0 # [N*m*s/rad]
33-
actionScale: 3.14
34-
controlFrequencyInv: 1 # 60 Hz
46+
# action scale: target angle = actionScale * action + defaultAngle
47+
actionScale: 0.5
48+
# decimation: Number of control action updates @ sim DT per policy DT
49+
decimation: 4
3550

3651
defaultJointAngles: # = target angles when action = 0.0
37-
left-back-shoulder-joint: 0.5 # [rad]
38-
right-back-shoulder-joint: -0.5 # [rad]
39-
left-front-shoulder-joint: -0.2 # [rad]
40-
right-front-shoulder-joint: 0.2 # [rad]
52+
LF_HAA: 0.03 # [rad]
53+
LH_HAA: 0.03 # [rad]
54+
RF_HAA: -0.03 # [rad]
55+
RH_HAA: -0.03 # [rad]
56+
57+
LF_HFE: 0.4 # [rad]
58+
LH_HFE: -0.4 # [rad]
59+
RF_HFE: 0.4 # [rad]
60+
RH_HFE: -0.4 # [rad]
4161

42-
left-back-knee-joint: -0.8 # [rad]
43-
right-back-knee-joint: 0.8 # [rad]
44-
left-front-knee-joint: -0.5 # [rad]
45-
right-front-knee-joint: 0.5 # [rad]
62+
LF_KFE: -0.8 # [rad]
63+
LH_KFE: 0.8 # [rad]
64+
RF_KFE: -0.8 # [rad]
65+
RH_KFE: 0.8 # [rad]
4666

4767
urdfAsset:
48-
collapseFixedJoints: True
49-
fixBaseLink: False
68+
file: "urdf/atlas/urdf/atlas_v4_with_multisense.urdf"
69+
footName: foot # SHANK if collapsing fixed joint, FOOT otherwise
70+
kneeName: glut
71+
collapseFixedJoints: true
72+
fixBaseLink: false
5073
defaultDofDriveMode: 1 # see GymDofDriveModeFlags (0 is none, 1 is pos tgt, 2 is vel tgt, 4 effort)
5174

5275
learn:
76+
allowKneeContacts: true
5377
# rewards
78+
terminalReward: 0.0
5479
linearVelocityXYRewardScale: 1.0
80+
linearVelocityZRewardScale: -4.0
81+
angularVelocityXYRewardScale: -0.05
5582
angularVelocityZRewardScale: 0.5
56-
torqueRewardScale: -0.00002
57-
headingScale: 0.25
58-
upScale: 0.1
83+
orientationRewardScale: -0. #-1.
84+
torqueRewardScale: -0.00002 # -0.000025
85+
jointAccRewardScale: -0.0005 # -0.0025
86+
baseHeightRewardScale: -0.0 #5
87+
feetAirTimeRewardScale: 1.0
88+
kneeCollisionRewardScale: -0.25
89+
feetStumbleRewardScale: -0. #-2.0
90+
actionRateRewardScale: -0.01
91+
# cosmetics
92+
hipRewardScale: -0. #25
5993

6094
# normalization
6195
linearVelocityScale: 2.0
6296
angularVelocityScale: 0.25
6397
dofPositionScale: 1.0
6498
dofVelocityScale: 0.05
99+
heightMeasurementScale: 5.0
100+
101+
# noise
102+
addNoise: false
103+
noiseLevel: 1.0 # scales other values
104+
dofPositionNoise: 0.01
105+
dofVelocityNoise: 1.5
106+
linearVelocityNoise: 0.1
107+
angularVelocityNoise: 0.2
108+
gravityNoise: 0.05
109+
heightMeasurementNoise: 0.06
110+
111+
#randomization
112+
randomizeFriction: false
113+
frictionRange: [0.5, 1.25]
114+
pushRobots: false
115+
pushInterval_s: 15
65116

66117
# episode length in seconds
67-
episodeLength_s: 50
118+
episodeLength_s: 20
68119

69120
# viewer cam:
70121
viewer:
71122
refEnv: 0
72-
pos: [0, 0, 4] # [m]
73-
lookat: [1., 1, 3.3] # [m]
123+
pos: [0, 0, 10] # [m]
124+
lookat: [1., 1, 9] # [m]
74125

75126
# set to True if you use camera sensors in the environment
76127
enableCameraSensors: False
@@ -94,74 +145,7 @@ sim:
94145
default_buffer_size_multiplier: 5.0
95146
max_gpu_contact_pairs: 8388608 # 8*1024*1024
96147
num_subscenes: ${....num_subscenes}
97-
contact_collection: 1 # 0: CC_NEVER (don't collect contact info), 1: CC_LAST_SUBSTEP (collect only contacts on last substep), 2: CC_ALL_SUBSTEPS (default - all contacts)
148+
contact_collection: 1 # 0: CC_NEVER (don't collect contact info), 1: CC_LAST_SUBSTEP (collect only contacts on last substep), 2: CC_ALL_SUBSTEPS (broken - do not use!)
98149

99150
task:
100151
randomize: False
101-
randomization_params:
102-
frequency: 600 # Define how many environment steps between generating new randomizations
103-
observations:
104-
range: [0, .002] # range for the white noise
105-
operation: "additive"
106-
distribution: "gaussian"
107-
actions:
108-
range: [0., .02]
109-
operation: "additive"
110-
distribution: "gaussian"
111-
sim_params:
112-
gravity:
113-
range: [0, 0.4]
114-
operation: "additive"
115-
distribution: "gaussian"
116-
schedule: "linear" # "linear" will linearly interpolate between no rand and max rand
117-
schedule_steps: 3000
118-
actor_params:
119-
anymal:
120-
color: True
121-
rigid_body_properties:
122-
mass:
123-
range: [0.5, 1.5]
124-
operation: "scaling"
125-
distribution: "uniform"
126-
setup_only: True # Property will only be randomized once before simulation is started. See Domain Randomization Documentation for more info.
127-
schedule: "linear" # "linear" will linearly interpolate between no rand and max rand
128-
schedule_steps: 3000
129-
rigid_shape_properties:
130-
friction:
131-
num_buckets: 500
132-
range: [0.7, 1.3]
133-
operation: "scaling"
134-
distribution: "uniform"
135-
schedule: "linear" # "linear" will scale the current random sample by `min(current num steps, schedule_steps) / schedule_steps`
136-
schedule_steps: 3000
137-
restitution:
138-
range: [0., 0.7]
139-
operation: "scaling"
140-
distribution: "uniform"
141-
schedule: "linear" # "linear" will scale the current random sample by `min(current num steps, schedule_steps) / schedule_steps`
142-
schedule_steps: 3000
143-
dof_properties:
144-
damping:
145-
range: [0.5, 1.5]
146-
operation: "scaling"
147-
distribution: "uniform"
148-
schedule: "linear" # "linear" will scale the current random sample by `min(current num steps, schedule_steps) / schedule_steps`
149-
schedule_steps: 3000
150-
stiffness:
151-
range: [0.5, 1.5]
152-
operation: "scaling"
153-
distribution: "uniform"
154-
schedule: "linear" # "linear" will scale the current random sample by `min(current num steps, schedule_steps) / schedule_steps`
155-
schedule_steps: 3000
156-
lower:
157-
range: [0, 0.01]
158-
operation: "additive"
159-
distribution: "gaussian"
160-
schedule: "linear" # "linear" will scale the current random sample by `min(current num steps, schedule_steps) / schedule_steps`
161-
schedule_steps: 3000
162-
upper:
163-
range: [0, 0.01]
164-
operation: "additive"
165-
distribution: "gaussian"
166-
schedule: "linear" # "linear" will scale the current random sample by `min(current num steps, schedule_steps) / schedule_steps`
167-
schedule_steps: 3000

isaacgymenvs/cfg/train/AtlasPPO.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ params:
6767
truncate_grads: True
6868
grad_norm: 1.
6969
horizon_length: 24
70-
minibatch_size: 16
70+
minibatch_size: 512
7171
mini_epochs: 5
7272
critic_coef: 2
7373
clip_value: True

0 commit comments

Comments
 (0)