Skip to content

Commit

Permalink
Aggregated changes for open-sourcing
Browse files Browse the repository at this point in the history
Signed-off-by: Mihir Kulkarni <[email protected]>
  • Loading branch information
mihirk284 committed Nov 8, 2024
1 parent 070391c commit 83bbdbe
Show file tree
Hide file tree
Showing 151 changed files with 44,965 additions and 217 deletions.
540 changes: 540 additions & 0 deletions aerial_gym/config/asset_config/dynamic_env_object_config.py

Large diffs are not rendered by default.

58 changes: 58 additions & 0 deletions aerial_gym/config/asset_config/env_object_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,64 @@ class panel_asset_params(asset_state_params):
color = [170, 66, 66]


class tile_asset_params(asset_state_params):
num_assets = 1

asset_folder = f"{AERIAL_GYM_DIRECTORY}/resources/models/environment_assets/tile_meshes"

collision_mask = 1 # objects with the same collision mask will not collide

min_position_ratio = [0.3, 0.05, 0.05] # max position as a ratio of the bounds
max_position_ratio = [0.85, 0.95, 0.95] # min position as a ratio of the bounds

specified_position = [
-1000.0,
-1000.0,
-1000.0,
] # if > -900, use this value instead of randomizing the ratios

min_euler_angles = [0.0, 0.0, 0.0] # min euler angles
max_euler_angles = [0.0, 0.0, 0.0] # max euler angles

min_state_ratio = [
0.5,
0.5,
0.5,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
]
max_state_ratio = [
0.5,
0.5,
0.5,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
0.0,
]

keep_in_env = True

collapse_fixed_joints = True
per_link_semantic = False
semantic_id = -1 # will be assigned incrementally per instance
# color = [170, 66, 66]


class thin_asset_params(asset_state_params):
num_assets = 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ class control:
] # used for lee_position_control, lee_velocity_control and lee_attitude_control
K_angvel_tensor_min = [0.1, 0.1, 0.1]

randomize_params = True
randomize_params = False
45 changes: 45 additions & 0 deletions aerial_gym/config/controller_config/lmf2_controller_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import numpy as np


class control:
"""
Control parameters
controller:
lee_position_control: command_actions = [x, y, z, yaw] in environment frame scaled between -1 and 1
lee_velocity_control: command_actions = [vx, vy, vz, yaw_rate] in vehicle frame scaled between -1 and 1
lee_attitude_control: command_actions = [thrust, roll, pitch, yaw_rate] in vehicle frame scaled between -1 and 1
kP: gains for position
kV: gains for velocity
kR: gains for attitude
kOmega: gains for angular velocity
"""

num_actions = 4
max_inclination_angle_rad = np.pi / 3.0
max_yaw_rate = np.pi / 3.0

K_pos_tensor_max = [2.0, 2.0, 1.0] # used for lee_position_control only
K_pos_tensor_min = [2.0, 2.0, 1.0] # used for lee_position_control only

K_vel_tensor_max = [
3.3,
3.3,
1.3,
] # used for lee_position_control, lee_velocity_control only
K_vel_tensor_min = [2.7, 2.7, 1.7]

K_rot_tensor_max = [
1.85,
1.85,
0.4,
] # used for lee_position_control, lee_velocity_control and lee_attitude_control
K_rot_tensor_min = [1.6, 1.6, 0.25]

K_angvel_tensor_max = [
0.5,
0.5,
0.09,
] # used for lee_position_control, lee_velocity_control and lee_attitude_control
K_angvel_tensor_min = [0.4, 0.4, 0.075]

randomize_params = True
61 changes: 61 additions & 0 deletions aerial_gym/config/env_config/dynamic_environment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
from aerial_gym.config.asset_config.dynamic_env_object_config import *

import numpy as np


class DynamicEnvironmentCfg:
class env:
num_envs = 64 # overridden by the num_envs parameter in the task config if used
num_env_actions = 6 # this is the number of actions handled by the environment
# potentially some of these can be input from the RL agent for the robot and
# some of them can be used to control various entities in the environment
# e.g. motion of obstacles, etc.
env_spacing = 5.0 # not used with heightfields/trimeshes

num_physics_steps_per_env_step_mean = 10 # number of steps between camera renders mean
num_physics_steps_per_env_step_std = 0 # number of steps between camera renders std

render_viewer_every_n_steps = 1 # render the viewer every n steps
reset_on_collision = (
True # reset environment when contact force on quadrotor is above a threshold
)
collision_force_threshold = 0.05 # collision force threshold [N]
create_ground_plane = True # create a ground plane
sample_timestep_for_latency = True # sample the timestep for the latency noise
perturb_observations = True
keep_same_env_for_num_episodes = 1
write_to_sim_at_every_timestep = True # write to sim at every timestep

use_warp = True
lower_bound_min = [-2.0, -4.0, 0.0] # lower bound for the environment space
lower_bound_max = [-1.0, -2.5, 0.0] # lower bound for the environment space
upper_bound_min = [9.0, 2.5, 4.0] # upper bound for the environment space
upper_bound_max = [10.0, 4.0, 5.0] # upper bound for the environment space

class env_config:
include_asset_type = {
"panels": False,
"thin": False,
"trees": False,
"objects": True,
"left_wall": False,
"right_wall": False,
"back_wall": False,
"front_wall": False,
"top_wall": False,
"bottom_wall": False,
}

# maps the above names to the classes defining the assets. They can be enabled and disabled above in include_asset_type
asset_type_to_dict_map = {
"panels": panel_asset_params,
"thin": thin_asset_params,
"trees": tree_asset_params,
"objects": object_asset_params,
"left_wall": left_wall,
"right_wall": right_wall,
"back_wall": back_wall,
"front_wall": front_wall,
"bottom_wall": bottom_wall,
"top_wall": top_wall,
}
1 change: 1 addition & 0 deletions aerial_gym/config/env_config/empty_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class env:
sample_timestep_for_latency = True # sample the timestep for the latency noise
perturb_observations = True
keep_same_env_for_num_episodes = 1
write_to_sim_at_every_timestep = False # write to sim at every timestep

use_warp = False
e_s = env_spacing
Expand Down
37 changes: 37 additions & 0 deletions aerial_gym/config/env_config/env_config_2ms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# nothing to import here as the no other modules are needed to define base class


class EnvCfg2Ms:
class env:
num_envs = 3 # number of environments
num_env_actions = 0 # this is the number of actions handled by the environment
# these are the actions that are sent to environment entities
# and some of them may be used to control various entities in the environment
# e.g. motion of obstacles, etc.
env_spacing = 1.0 # not used with heightfields/trimeshes
num_physics_steps_per_env_step_mean = 5 # number of steps between camera renders mean
num_physics_steps_per_env_step_std = 0 # number of steps between camera renders std
render_viewer_every_n_steps = 2 # render the viewer every n steps
collision_force_threshold = 0.010 # collision force threshold
manual_camera_trigger = False # trigger camera captures manually
reset_on_collision = (
True # reset environment when contact force on quadrotor is above a threshold
)
write_to_sim_at_every_timestep = False
create_ground_plane = False # create a ground plane
sample_timestep_for_latency = True # sample the timestep for the latency noise
perturb_observations = True
keep_same_env_for_num_episodes = 1
write_to_sim_at_every_timestep = False

use_warp = False
e_s = env_spacing
lower_bound_min = [-e_s, -e_s, -e_s] # lower bound for the environment space
lower_bound_max = [-e_s, -e_s, -e_s] # lower bound for the environment space
upper_bound_min = [e_s, e_s, e_s] # upper bound for the environment space
upper_bound_max = [e_s, e_s, e_s] # upper bound for the environment space

class env_config:
include_asset_type = {}

asset_type_to_dict_map = {}
6 changes: 5 additions & 1 deletion aerial_gym/config/env_config/env_with_obstacles.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
thin_asset_params,
tree_asset_params,
object_asset_params,
tile_asset_params,
)
from aerial_gym.config.asset_config.env_object_config import (
left_wall,
Expand Down Expand Up @@ -37,6 +38,7 @@ class env:
sample_timestep_for_latency = True # sample the timestep for the latency noise
perturb_observations = True
keep_same_env_for_num_episodes = 1
write_to_sim_at_every_timestep = False # write to sim at every timestep

use_warp = True
lower_bound_min = [-2.0, -4.0, -3.0] # lower bound for the environment space
Expand All @@ -47,14 +49,15 @@ class env:
class env_config:
include_asset_type = {
"panels": True,
"tiles": False,
"thin": False,
"trees": False,
"objects": True,
"left_wall": True,
"right_wall": True,
"back_wall": True,
"front_wall": True,
"top_wall": False,
"top_wall": True,
"bottom_wall": True,
}

Expand All @@ -70,4 +73,5 @@ class env_config:
"front_wall": front_wall,
"bottom_wall": bottom_wall,
"top_wall": top_wall,
"tiles": tile_asset_params,
}
1 change: 1 addition & 0 deletions aerial_gym/config/env_config/forest_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class env:
sample_timestep_for_latency = True # sample the timestep for the latency noise
perturb_observations = True
keep_same_env_for_num_episodes = 1
write_to_sim_at_every_timestep = False # write to sim at every timestep

use_warp = True
lower_bound_min = [-5.0, -5.0, -1.0] # lower bound for the environment space
Expand Down
38 changes: 23 additions & 15 deletions aerial_gym/config/robot_config/base_octarotor_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,43 +191,51 @@ class control_allocator_config:
0.57735027,
],
[
-0.01547005,
-0.25773503,
0.21547005,
-0.14226497,
0.14226497,
-0.21547005,
0.25773503,
0.01547005,
-0.01547005,
-0.25773503,
0.21547005,
-0.14226497,
],
[
-0.21547005,
-0.14226497,
-0.01547005,
0.25773503,
-0.25773503,
0.01547005,
0.14226497,
0.21547005,
-0.21547005,
-0.14226497,
-0.01547005,
0.25773503,
],
[
0.23094011,
-0.11547005,
-0.23094011,
0.11547005,
-0.23094011,
-0.11547005,
0.23094011,
0.11547005,
-0.23094011,
0.11547005,
0.23094011,
-0.11547005,
],
]

class motor_model_config:
motor_time_constant_min = 0.01
motor_time_constant_max = 0.03
use_rps = False
motor_thrust_constant_min = 0.00000926312
motor_thrust_constant_max = 0.00001826312
motor_time_constant_increasing_min = 0.01
motor_time_constant_increasing_max = 0.03
motor_time_constant_decreasing_min = 0.005
motor_time_constant_decreasing_max = 0.005
max_thrust = 6.25
min_thrust = -6.25
max_thrust_rate = 100.0
max_thrust_rate = 100000.0
thrust_to_torque_ratio = (
0.01 # thrust to torque ratio is related to inertia matrix dont change
)
use_discrete_approximation = (
True # Setting to false will compute f' based on difference and time constant
)
Loading

0 comments on commit 83bbdbe

Please sign in to comment.