grasp_reward
GraspReward
Bases: BaseRewardFunction
A composite reward function for grasping tasks. This reward function not only evaluates the success of object grasping but also considers various penalties and efficiencies.
The reward is calculated based on several factors: - Grasping reward: A positive reward is given if the robot is currently grasping the specified object. - Distance reward: A reward based on the inverse exponential distance between the end-effector and the object. - Regularization penalty: Penalizes large magnitude actions to encourage smoother and more energy-efficient movements. - Position and orientation penalties: Discourages excessive movement of the end-effector. - Collision penalty: Penalizes collisions with the environment or other objects.
Attributes:
| Name | Type | Description |
|---|---|---|
obj_name |
str
|
Name of the object to grasp. |
dist_coeff |
float
|
Coefficient for the distance reward calculation. |
grasp_reward |
float
|
Reward given for successfully grasping the object. |
collision_penalty |
float
|
Penalty incurred for any collision. |
eef_position_penalty_coef |
float
|
Coefficient for the penalty based on end-effector's position change. |
eef_orientation_penalty_coef |
float
|
Coefficient for the penalty based on end-effector's orientation change. |
regularization_coef |
float
|
Coefficient for penalizing large actions. |
Source code in OmniGibson/omnigibson/reward_functions/grasp_reward.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
reset(task, env, env_indices)
Reward function-specific reset
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
task
|
BaseTask
|
Task instance |
required |
env
|
Environment
|
Environment instance |
required |
env_indices
|
list
|
List of environment indices to reset |
required |