file_path
stringlengths
21
202
content
stringlengths
12
1.02M
size
int64
12
1.02M
lang
stringclasses
9 values
avg_line_length
float64
3.33
100
max_line_length
int64
10
993
alphanum_fraction
float64
0.27
0.93
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/include/hardware_config.h
#ifndef HARDWARE_CONFIG_H #define HARDWARE_CONFIG_H #define USE_SIMULATION_ACTUATOR // #define USE_DYNAMIXEL_ACTUATOR // #define USE_SERVO_ACTUATOR // #define USE_BRUSHLESS_ACTUATOR #define USE_SIMULATION_IMU // #define USE_BNO0809DOF_IMU #define USE_ROS // #define USE_ROS_RF #ifdef USE_ROS_RF #define ELE_PIN 16 #define AIL_PIN 21 #define RUD_PIN 17 #define THR_PIN 20 #define AUX1_PIN 22 #define AUX2_PIN 23 #define RF_INV_LX false #define RF_INV_LY false #define RF_INV_AZ false #define RF_INV_ROLL true #define RF_INV_PITCH false #define RF_INV_YAW false #endif #ifdef USE_DYNAMIXEL_ACTUATOR #define LFH_SERVO_ID 16 #define LFU_SERVO_ID 17 #define LFL_SERVO_ID 18 #define RFH_SERVO_ID 14 #define RFU_SERVO_ID 7 #define RFL_SERVO_ID 4 #define LHH_SERVO_ID 2 #define LHU_SERVO_ID 11 #define LHL_SERVO_ID 12 #define RHH_SERVO_ID 6 #define RHU_SERVO_ID 5 #define RHL_SERVO_ID 8 #define LFH_INV false #define LFU_INV false #define LFL_INV true #define RFH_INV false #define RFU_INV true #define RFL_INV false #define LHH_INV false #define LHU_INV false #define LHL_INV true #define RHH_INV false #define RHU_INV true #define RHL_INV false #endif #ifdef USE_SERVO_ACTUATOR #define LFH_PIN 8 #define LFU_PIN 7 #define LFL_PIN 6 #define RFH_PIN 14 #define RFU_PIN 16 #define RFL_PIN 17 #define LHH_PIN 4 #define LHU_PIN 3 #define LHL_PIN 2 #define RHH_PIN 21 #define RHU_PIN 22 #define RHL_PIN 23 #define LFH_OFFSET 0 #define LFU_OFFSET 0 #define LFL_OFFSET 0 #define RFH_OFFSET 0 #define RFU_OFFSET 0 #define RFL_OFFSET 0 #define LHH_OFFSET 0 #define LHU_OFFSET 0 #define LHL_OFFSET 3 #define RHH_OFFSET 0 #define RHU_OFFSET 0 #define RHL_OFFSET 0 #define LFH_INV false #define LFU_INV false #define LFL_INV false #define RFH_INV false #define RFU_INV true #define RFL_INV true #define LHH_INV true #define LHU_INV false #define LHL_INV false #define RHH_INV true #define RHU_INV true #define RHL_INV true #endif #endif
2,231
C
18.578947
33
0.651277
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/include/gait_config.h
#ifndef GAIT_CONFIG_H #define GAIT_CONFIG_H #define KNEE_ORIENTATION ">>" #define PANTOGRAPH_LEG false #define ODOM_SCALER 1.15 #define MAX_LINEAR_VELOCITY_X 0.5 #define MAX_LINEAR_VELOCITY_Y 0.25 #define MAX_ANGULAR_VELOCITY_Z 1.0 #define COM_X_TRANSLATION -0.05 #define SWING_HEIGHT 0.035 #define STANCE_DEPTH 0.0 #define STANCE_DURATION 0.25 #define NOMINAL_HEIGHT 0.35 #endif
459
C
27.749998
37
0.636166
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/links/links.yaml
base: base_link left_front: - lf_hip_link - lf_upper_leg_link - lf_lower_leg_link - lf_foot_link right_front: - rf_hip_link - rf_upper_leg_link - rf_lower_leg_link - rf_foot_link left_hind: - lh_hip_link - lh_upper_leg_link - lh_lower_leg_link - lh_foot_link right_hind: - rh_hip_link - rh_upper_leg_link - rh_lower_leg_link - rh_foot_link
374
YAML
14.624999
21
0.631016
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - lf_hip_joint - lf_upper_leg_joint - lf_lower_leg_joint - rf_hip_joint - rf_upper_leg_joint - rf_lower_leg_joint - lh_hip_joint - lh_upper_leg_joint - lh_lower_leg_joint - rh_hip_joint - rh_upper_leg_joint - rh_lower_leg_joint gains: lf_hip_joint : {p: 180, d: 0.9, i: 20} lf_upper_leg_joint : {p: 180, d: 0.9, i: 20} lf_lower_leg_joint : {p: 180, d: 0.9, i: 20} rf_hip_joint : {p: 180, d: 0.9, i: 20} rf_upper_leg_joint : {p: 180, d: 0.9, i: 20} rf_lower_leg_joint : {p: 180, d: 0.9, i: 20} lh_hip_joint : {p: 180, d: 0.9, i: 20} lh_upper_leg_joint : {p: 180, d: 0.9, i: 20} lh_lower_leg_joint : {p: 180, d: 0.9, i: 20} rh_hip_joint : {p: 180, d: 0.9, i: 20} rh_upper_leg_joint : {p: 180, d: 0.9, i: 20} rh_lower_leg_joint : {p: 180, d: 0.9, i: 20}
1,191
YAML
33.057142
56
0.506297
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/gait/gait.yaml
knee_orientation : ">>" pantograph_leg : false odom_scaler: 1.0 max_linear_velocity_x : 0.5 max_linear_velocity_y : 0.25 max_angular_velocity_z : 1.0 com_x_translation : -0.05 swing_height : 0.035 stance_depth : 0.0 stance_duration : 0.25 nominal_height : 0.28
260
YAML
22.727271
28
0.715385
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/joints/joints.yaml
left_front: - lf_hip_joint - lf_upper_leg_joint - lf_lower_leg_joint - lf_foot_joint right_front: - rf_hip_joint - rf_upper_leg_joint - rf_lower_leg_joint - rf_foot_joint left_hind: - lh_hip_joint - lh_upper_leg_joint - lh_lower_leg_joint - lh_foot_joint right_hind: - rh_hip_joint - rh_upper_leg_joint - rh_lower_leg_joint - rh_foot_joint
374
YAML
15.304347
22
0.641711
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/move_base/costmap_common_params.yaml
obstacle_range: 2.5 raytrace_range: 3.0 footprint: [[-0.25, -0.145], [-0.25, 0.145], [0.25, 0.145], [0.25, -0.145]] transform_tolerance: 0.5 resolution: 0.05 static_map_layer: map_topic: map subscribe_to_updates: true 2d_obstacles_layer: observation_sources: scan scan: {data_type: LaserScan, topic: scan, marking: true, clearing: true} 3d_obstacles_layer: observation_sources: depth depth: {data_type: PointCloud2, topic: camera/depth/points, min_obstacle_height: 0.1, marking: true, clearing: true} inflation_layer: inflation_radius: 2.0
594
YAML
20.249999
75
0.666667
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/move_base/base_local_planner_holonomic_params.yaml
DWAPlannerROS: #http://wiki.ros.org/dwa_local_planner min_vel_trans: 0.01 max_vel_trans: 0.5 min_vel_x: -0.025 max_vel_x: 0.5 min_vel_y: 0.0 max_vel_y: 0.0 max_vel_rot: 1.0 min_vel_rot: -1.0 acc_lim_trans: 1.7 acc_lim_x: 1.7 acc_lim_y: 0.0 acc_lim_theta: 3 trans_stopped_vel: 0.1 theta_stopped_vel: 0.1 xy_goal_tolerance: 0.25 yaw_goal_tolerance: 0.34 sim_time: 3.5 sim_granularity: 0.1 vx_samples: 20 vy_samples: 0 vth_samples: 40 path_distance_bias: 34.0 goal_distance_bias: 24.0 occdist_scale: 0.05 forward_point_distance: 0.2 stop_time_buffer: 0.5 scaling_speed: 0.25 max_scaling_factor: 0.2 oscillation_reset_dist: 0.05 use_dwa: true prune_plan: false
734
YAML
14.638298
40
0.643052
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/move_base/move_base_params.yaml
base_global_planner: global_planner/GlobalPlanner base_local_planner: dwa_local_planner/DWAPlannerROS shutdown_costmaps: false controller_frequency: 5.0 controller_patience: 3.0 planner_frequency: 0.5 planner_patience: 5.0 oscillation_timeout: 10.0 oscillation_distance: 0.2 conservative_reset_dist: 0.1
308
YAML
19.599999
51
0.808442
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/move_base/global_costmap_params.yaml
global_costmap: global_frame: map robot_base_frame: base_footprint update_frequency: 1.0 publish_frequency: 0.5 static_map: true cost_scaling_factor: 10.0 plugins: - {name: static_map_layer, type: "costmap_2d::StaticLayer"} - {name: inflation_layer, type: "costmap_2d::InflationLayer"} - {name: 2d_obstacles_layer, type: "costmap_2d::ObstacleLayer"} - {name: 3d_obstacles_layer, type: "costmap_2d::VoxelLayer"}
453
YAML
31.428569
69
0.673289
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/opendog_config/config/move_base/local_costmap_params.yaml
local_costmap: global_frame: odom robot_base_frame: base_footprint update_frequency: 1.0 publish_frequency: 2.0 static_map: false rolling_window: true width: 2.5 height: 2.5 cost_scaling_factor: 5 plugins: - {name: inflation_layer, type: "costmap_2d::InflationLayer"} - {name: 2d_obstacles_layer, type: "costmap_2d::ObstacleLayer"} - {name: 3d_obstacles_layer, type: "costmap_2d::VoxelLayer"}
435
YAML
24.647057
69
0.675862
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spot_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.29785, 0.055, 0.0, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0, 0.110945, -0.0, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(0.025, 0.0, -0.3205, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.0, 0.0, -0.37, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.29785, -0.055, 0.0, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0, -0.110945, -0.0, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(0.025, 0.0, -0.3205, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.0, 0.0, -0.37, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.29785, 0.055, 0.0, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0, 0.110945, -0.0, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(0.025, 0.0, -0.3205, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(0.0, 0.0, -0.37, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.29785, -0.055, 0.0, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0, -0.110945, -0.0, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(0.025, 0.0, -0.3205, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(0.0, 0.0, -0.37, 0.0, 0.0, 0.0); } } } #endif
1,275
C
36.529411
66
0.589804
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spot_config/config/links/links.yaml
base: body left_front: - front_left_hip - front_left_upper_leg - front_left_lower_leg - front_left_ee right_front: - front_right_hip - front_right_upper_leg - front_right_lower_leg - front_right_ee left_hind: - rear_left_hip - rear_left_upper_leg - rear_left_lower_leg - rear_left_ee right_hind: - rear_right_hip - rear_right_upper_leg - rear_right_lower_leg - rear_right_ee
409
YAML
16.083333
25
0.665037
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spot_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - front_left_hip_x - front_left_hip_y - front_left_knee - front_right_hip_x - front_right_hip_y - front_right_knee - rear_left_hip_x - rear_left_hip_y - rear_left_knee - rear_right_hip_x - rear_right_hip_y - rear_right_knee gains: front_left_hip_x : {p: 600, i: 0.9, d: 20} front_left_hip_y : {p: 600, i: 0.9, d: 20} front_left_knee : {p: 600, i: 0.9, d: 20} front_right_hip_x : {p: 600, i: 0.9, d: 20} front_right_hip_y : {p: 600, i: 0.9, d: 20} front_right_knee : {p: 600, i: 0.9, d: 20} rear_left_hip_x : {p: 600, i: 0.9, d: 20} rear_left_hip_y : {p: 600, i: 0.9, d: 20} rear_left_knee : {p: 600, i: 0.9, d: 20} rear_right_hip_x : {p: 600, i: 0.9, d: 20} rear_right_hip_y : {p: 600, i: 0.9, d: 20} rear_right_knee : {p: 600, i: 0.9, d: 20}
1,199
YAML
33.285713
56
0.496247
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spot_config/config/gait/gait.yaml
knee_orientation : ">>" pantograph_leg : false odom_scaler: 1.0 max_linear_velocity_x : 1.5 max_linear_velocity_y : 0.25 max_angular_velocity_z : 1.0 com_x_translation : -0.05 swing_height : 0.06 stance_depth : -0.01 stance_duration : 0.4 nominal_height : 0.48
260
YAML
22.727271
28
0.711538
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spot_config/config/joints/joints.yaml
left_front: - front_left_hip_x - front_left_hip_y - front_left_knee - front_left_foot right_front: - front_right_hip_x - front_right_hip_y - front_right_knee - front_right_foot left_hind: - rear_left_hip_x - rear_left_hip_y - rear_left_knee - rear_left_foot right_hind: - rear_right_hip_x - rear_right_hip_y - rear_right_knee - rear_right_foot
378
YAML
15.47826
21
0.645503
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stochlite_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.16695, 0.0956, -0.0050001, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0, 0.052019, -0.0, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(0.0, 0.023481, -0.146, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.0, 0.023481, -0.169, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.16695, -0.0964, -0.0049999, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0, -0.052019, -0.0, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(0.0, -0.023481, -0.146, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.0, -0.023481, -0.169, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.16695, 0.0956, -0.0049999, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0, 0.052019, -0.0, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(0.0, 0.023481, -0.146, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(0.0, 0.023481, -0.169, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.16695, -0.0964, -0.0050001, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0, -0.052019, -0.0, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(0.0, -0.023481, -0.146, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(0.0, -0.023481, -0.169, 0.0, 0.0, 0.0); } } } #endif
1,343
C
38.529411
74
0.604617
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stochlite_config/config/links/links.yaml
base: base_link left_front: - fl_abd_link - fl_thigh_link - fl_shank_link - fl_toe_link right_front: - fr_abd_link - fr_thigh_link - fr_shank_link - fr_toe_link left_hind: - bl_abd_link - bl_thigh_link - bl_shank_link - bl_toe_link right_hind: - br_abd_link - br_thigh_link - br_shank_link - br_toe_link
338
YAML
13.124999
17
0.615385
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stochlite_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - fl_abd_joint - fl_hip_joint - fl_knee_joint - fr_abd_joint - fr_hip_joint - fr_knee_joint - bl_abd_joint - bl_hip_joint - bl_knee_joint - br_abd_joint - br_hip_joint - br_knee_joint # constraints: # goal_time: 0.01 # stopped_velocity_tolerance: 0.01 # stop_trajectory_duration: 0.01 gains: fl_abd_joint : {p: 100, d: 6, i: 0.2} fl_hip_joint : {p: 100, d: 6, i: 0.2} fl_knee_joint : {p: 100, d: 6, i: 0.2} fr_abd_joint : {p: 100, d: 6, i: 0.2} fr_hip_joint : {p: 100, d: 6, i: 0.2} fr_knee_joint : {p: 100, d: 6, i: 0.2} bl_abd_joint : {p: 100, d: 6, i: 0.2} bl_hip_joint : {p: 100, d: 6, i: 0.2} bl_knee_joint : {p: 100, d: 6, i: 0.2} br_abd_joint : {p: 100, d: 6, i: 0.2} br_hip_joint : {p: 100, d: 6, i: 0.2} br_knee_joint : {p: 100, d: 6, i: 0.2}
1,236
YAML
29.170731
56
0.479773
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stochlite_config/config/gait/gait.yaml
knee_orientation : "><" pantograph_leg : false odom_scaler: 1.0 max_linear_velocity_x : 0.4 max_linear_velocity_y : 0.25 max_angular_velocity_z : 1.0 com_x_translation : 0.0 swing_height : 0.04 stance_depth : 0.0 stance_duration : 0.25 nominal_height : 0.23
257
YAML
22.454543
28
0.715953
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stochlite_config/config/joints/joints.yaml
left_front: - fl_abd_joint - fl_hip_joint - fl_knee_joint - fl_toe_joint right_front: - fr_abd_joint - fr_hip_joint - fr_knee_joint - fr_toe_joint left_hind: - bl_abd_joint - bl_hip_joint - bl_knee_joint - bl_toe_joint right_hind: - br_abd_joint - br_hip_joint - br_knee_joint - br_toe_joint
326
YAML
13.217391
17
0.613497
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dream_walker_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.4585, 0.083, 0.0, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0, 0.203, -0.0, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(0.0, 0.075, -0.32, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.0, 0.0, -0.44, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.4585, -0.083, 0.0, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0, -0.203, -0.0, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(0.0, -0.075, -0.32, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.0, 0.0, -0.44, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.4585, 0.083, 0.0, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0, 0.203, -0.0, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(0.0, 0.075, -0.32, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(0.0, 0.0, -0.44, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.4585, -0.083, 0.0, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0, -0.203, -0.0, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(0.0, -0.075, -0.32, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(0.0, 0.0, -0.44, 0.0, 0.0, 0.0); } } } #endif
1,253
C
35.882352
65
0.581006
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dream_walker_config/config/links/links.yaml
base: base_link left_front: - B1_Link - B2_Link - B3_Link - B4_Link right_front: - A1_Link - A2_Link - A3_Link - A4_Link left_hind: - D1_Link - D2_Link - D3_Link - D4_Link right_hind: - C1_Link - C2_Link - C3_Link - C4_Link
258
YAML
9.791666
15
0.55814
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dream_walker_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - B1_joint - B2_joint - B3_joint - A1_joint - A2_joint - A3_joint - D1_joint - D2_joint - D3_joint - C1_joint - C2_joint - C3_joint gains: B1_joint : {p: 180, d: 0.9, i: 20} B2_joint : {p: 180, d: 0.9, i: 20} B3_joint : {p: 180, d: 0.9, i: 20} A1_joint : {p: 180, d: 0.9, i: 20} A2_joint : {p: 180, d: 0.9, i: 20} A3_joint : {p: 180, d: 0.9, i: 20} D1_joint : {p: 180, d: 0.9, i: 20} D2_joint : {p: 180, d: 0.9, i: 20} D3_joint : {p: 180, d: 0.9, i: 20} C1_joint : {p: 180, d: 0.9, i: 20} C2_joint : {p: 180, d: 0.9, i: 20} C3_joint : {p: 180, d: 0.9, i: 20}
999
YAML
27.571428
56
0.451451
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dream_walker_config/config/joints/joints.yaml
left_front: - B1_joint - B2_joint - B3_joint - B4_joint right_front: - A1_joint - A2_joint - A3_joint - A4_joint left_hind: - D1_joint - D2_joint - D3_joint - D4_joint right_hind: - C1_joint - C2_joint - C3_joint - C4_joint
258
YAML
10.260869
12
0.573643
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/mini_cheetah_config/config/links/links.yaml
base: trunk left_front: - FL_hip - FL_thigh - FL_calf - FL_foot right_front: - FR_hip - FR_thigh - FR_calf - FR_foot left_hind: - RL_hip - RL_thigh - RL_calf - RL_foot right_hind: - RR_hip - RR_thigh - RR_calf - RR_foot
254
YAML
9.625
12
0.555118
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/mini_cheetah_config/config/gait/gait.yaml
knee_orientation : ">>" pantograph_leg : false odom_scaler: 0.9 max_linear_velocity_x : 0.5 max_linear_velocity_y : 0.25 max_angular_velocity_z : 1.0 com_x_translation : 0.0 swing_height : 0.05 stance_depth : 0.0 stance_duration : 0.3 nominal_height : 0.3
255
YAML
22.272725
28
0.713725
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/mini_cheetah_config/config/joints/joints.yaml
left_front: - FL_hip_joint - FL_thigh_joint - FL_calf_joint - FL_foot_fixed right_front: - FR_hip_joint - FR_thigh_joint - FR_calf_joint - FR_foot_fixed left_hind: - RL_hip_joint - RL_thigh_joint - RL_calf_joint - RL_foot_fixed right_hind: - RR_hip_joint - RR_thigh_joint - RR_calf_joint - RR_foot_fixed
338
YAML
13.73913
18
0.627219
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/aliengo_config/config/gait/gait.yaml
knee_orientation : ">>" pantograph_leg : false odom_scaler: 0.9 max_linear_velocity_x : 1.5 max_linear_velocity_y : 0.25 max_angular_velocity_z : 1.0 com_x_translation : -0.05 swing_height : 0.06 stance_depth : 0.0 stance_duration : 0.4 nominal_height : 0.35
258
YAML
22.545452
28
0.713178
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stanford_pupper_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.0705, 0.04, 0.02425, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.02735, 0.029523, -0.0012724, 0.0, 0.0, -1.5708); base.lf.lower_leg.setOrigin(-0.00516, -0.10458, -0.065536, -0.043072, 0.0, 1.5708); base.lf.foot.setOrigin(0.097, -0.0055, -0.064, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.0705, -0.04, 0.02425, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.02735, -0.029523, -0.0012724, 0.0, 0.0, -1.5708); base.rf.lower_leg.setOrigin(0.00516, -0.10458, -0.065536, -0.043072, 0.0, 1.5708); base.rf.foot.setOrigin(0.097, 0.0054, -0.064, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.1299, 0.04, 0.02425, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.02775, 0.029523, -0.0012724, 0.0, 0.0, -1.5708); base.lh.lower_leg.setOrigin(-0.0054498, -0.10458, -0.065524, -0.043072, 0.0, 1.5708); base.lh.foot.setOrigin(0.097, -0.0055, -0.064, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.0705, -0.04, 0.02425, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(-0.17265, -0.029523, -0.0012724, 0.0, 0.0, -1.5708); base.rh.lower_leg.setOrigin(0.0054098, -0.10458, -0.065525, -0.043072, 0.0, 1.5708); base.rh.foot.setOrigin(0.097, 0.0054, -0.064, 0.0, 0.0, 0.0); } } } #endif
1,444
C
41.499999
85
0.626039
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stanford_pupper_config/config/links/links.yaml
base: base_link left_front: - LF_HIP - LF_THIGH - LF_THIGH_FOOT - LF_TOE right_front: - RF_HIP - RF_THIGH - RF_THIGH_FOOT - RF_TOE left_hind: - LH_HIP - LH_THIGH - LH_THIGH_FOOT - LH_TOE right_hind: - RH_HIP - RH_THIGH - RH_THIGH_FOOT - RH_TOE
278
YAML
10.625
17
0.57554
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stanford_pupper_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - LF_HIP_JOINT - LF_THIGH_JOINT - LF_THIGH_FOOT_JOINT - RF_HIP_JOINT - RF_THIGH_JOINT - RF_THIGH_FOOT_JOINT - LH_HIP_JOINT - LH_THIGH_JOINT - LH_THIGH_FOOT_JOINT - RH_HIP_JOINT - RH_THIGH_JOINT - RH_THIGH_FOOT_JOINT gains: LF_HIP_JOINT : {p: 100, d: 0.00000001, i: 0.5} LF_THIGH_JOINT : {p: 50, d: 0.0000001, i: 0.2} LF_THIGH_FOOT_JOINT : {p: 10, d: 0.00000001, i: 0.1} RF_HIP_JOINT : {p: 100, d: 0.00000001, i: 0.5} RF_THIGH_JOINT : {p: 50, d: 0.0000001, i: 0.2} RF_THIGH_FOOT_JOINT : {p: 10, d: 0.00000001, i: 0.1} LH_HIP_JOINT : {p: 100, d: 0.00000001, i: 0.5} LH_THIGH_JOINT : {p: 50, d: 0.0000001, i: 0.2} LH_THIGH_FOOT_JOINT : {p: 10, d: 0.00000001, i: 0.1} RH_HIP_JOINT : {p: 100, d: 0.00000001, i: 0.5} RH_THIGH_JOINT : {p: 50, d: 0.0000001, i: 0.2} RH_THIGH_FOOT_JOINT : {p: 10, d: 0.00000001, i: 0.1}
1,255
YAML
32.052631
60
0.5251
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stanford_pupper_config/config/gait/gait.yaml
knee_orientation : ">>" pantograph_leg : false odom_scaler: 1.0 max_linear_velocity_x : 0.25 max_linear_velocity_y : 0.125 max_angular_velocity_z : 1.0 com_x_translation : 0.0 swing_height : 0.01 stance_depth : 0.0 stance_duration : 0.25 nominal_height : 0.15
259
YAML
22.636362
29
0.718147
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/stanford_pupper_config/config/joints/joints.yaml
left_front: - LF_HIP_JOINT - LF_THIGH_JOINT - LF_THIGH_FOOT_JOINT - LF_TOE_JOINT right_front: - RF_HIP_JOINT - RF_THIGH_JOINT - RF_THIGH_FOOT_JOINT - RF_TOE_JOINT left_hind: - LH_HIP_JOINT - LH_THIGH_JOINT - LH_THIGH_FOOT_JOINT - LH_TOE_JOINT right_hind: - RH_HIP_JOINT - RH_THIGH_JOINT - RH_THIGH_FOOT_JOINT - RH_TOE_JOINT
358
YAML
14.608695
23
0.636872
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/mini_pupper_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.06014, 0.0235, 0.0171, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0, 0.0197, -0.0, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(0.0, 0.00475, -0.05, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.0, 0.0, -0.056, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.06014, -0.0235, 0.0171, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0, -0.0197, -0.0, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(0.0, -0.00475, -0.05, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.0, 0.0, -0.056, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.05886, 0.0235, 0.0171, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0, 0.0197, -0.0, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(0.0, 0.00475, -0.05, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(0.0, 0.0, -0.056, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.05886, -0.0235, 0.0171, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0, -0.0197, -0.0, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(0.0, -0.00475, -0.05, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(0.0, 0.0, -0.056, 0.0, 0.0, 0.0); } } } #endif
1,289
C
36.941175
70
0.592708
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/mini_pupper_config/include/gait_config.h
#ifndef GAIT_CONFIG_H #define GAIT_CONFIG_H #define KNEE_ORIENTATION ">>" #define PANTOGRAPH_LEG false #define ODOM_SCALER 1.0 #define MAX_LINEAR_VELOCITY_X 0.2 #define MAX_LINEAR_VELOCITY_Y 0.1 #define MAX_ANGULAR_VELOCITY_Z 0.45 #define COM_X_TRANSLATION 0.0 #define SWING_HEIGHT 0.008 #define STANCE_DEPTH 0.0 #define STANCE_DURATION 0.25 #define NOMINAL_HEIGHT 0.045 #endif
457
C
27.624998
37
0.636761
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/mini_pupper_config/config/gait/gait.yaml
knee_orientation : ">>" pantograph_leg : false odom_scaler: 1.0 max_linear_velocity_x : 0.2 max_linear_velocity_y : 0.1 max_angular_velocity_z : 0.45 com_x_translation : 0.0 swing_height : 0.008 stance_depth : 0.0 stance_duration : 0.25 nominal_height : 0.045
259
YAML
22.636362
29
0.718147
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dkitty_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.1212, 0.0903, 0.0, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.0, 0.0, -0.10885, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.1212, -0.0903, 0.0, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.0, 0.0, -0.10885, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.1212, 0.0903, 0.0, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(0.0, 0.0, -0.10885, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.1212, -0.0903, 0.0, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(0.0, 0.0, -0.0955, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(0.0, 0.0, -0.10885, 0.0, 0.0, 0.0); } } } #endif
1,269
C
36.35294
66
0.589441
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dkitty_config/config/links/links.yaml
base: base_link left_front: - lf_hip_adapter_link - lf_upper_leg_adapter_link - lf_lower_leg_adapter_link - lf_foot_link right_front: - rf_hip_adapter_link - rf_upper_leg_adapter_link - rf_lower_leg_adapter_link - rf_foot_link left_hind: - lh_hip_adapter_link - lh_upper_leg_adapter_link - lh_lower_leg_adapter_link - lh_foot_link right_hind: - rh_hip_adapter_link - rh_upper_leg_adapter_link - rh_lower_leg_adapter_link - rh_foot_link
470
YAML
18.624999
29
0.680851
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dkitty_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - lf_hip_adapter_joint - lf_upper_leg_adapter_joint - lf_lower_leg_adapter_joint - rf_hip_adapter_joint - rf_upper_leg_adapter_joint - rf_lower_leg_adapter_joint - lh_hip_adapter_joint - lh_upper_leg_adapter_joint - lh_lower_leg_adapter_joint - rh_hip_adapter_joint - rh_upper_leg_adapter_joint - rh_lower_leg_adapter_joint gains: lf_hip_adapter_joint : {p: 180, d: 0.9, i: 20} lf_upper_leg_adapter_joint : {p: 180, d: 0.9, i: 20} lf_lower_leg_adapter_joint : {p: 180, d: 0.9, i: 20} rf_hip_adapter_joint : {p: 180, d: 0.9, i: 20} rf_upper_leg_adapter_joint : {p: 180, d: 0.9, i: 20} rf_lower_leg_adapter_joint : {p: 180, d: 0.9, i: 20} lh_hip_adapter_joint : {p: 180, d: 0.9, i: 20} lh_upper_leg_adapter_joint : {p: 180, d: 0.9, i: 20} lh_lower_leg_adapter_joint : {p: 180, d: 0.9, i: 20} rh_hip_adapter_joint : {p: 180, d: 0.9, i: 20} rh_upper_leg_adapter_joint : {p: 180, d: 0.9, i: 20} rh_lower_leg_adapter_joint : {p: 180, d: 0.9, i: 20}
1,383
YAML
38.542856
60
0.557484
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/dkitty_config/config/joints/joints.yaml
left_front: - lf_hip_adapter_joint - lf_upper_leg_adapter_joint - lf_lower_leg_adapter_joint - lf_foot_joint right_front: - rf_hip_adapter_joint - rf_upper_leg_adapter_joint - rf_lower_leg_adapter_joint - rf_foot_joint left_hind: - lh_hip_adapter_joint - lh_upper_leg_adapter_joint - lh_lower_leg_adapter_joint - lh_foot_joint right_hind: - rh_hip_adapter_joint - rh_upper_leg_adapter_joint - rh_lower_leg_adapter_joint - rh_foot_joint
470
YAML
19.47826
30
0.689362
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/bruno_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.1425, 0.04, 0.0, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0, 0.05, -0.04, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(0.015, 0.0, -0.148, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(-0.0225, 0.0, -0.15, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.1425, -0.04, 0.0, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0, -0.05, -0.04, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(0.015, 0.0, -0.148, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(-0.0225, 0.0, -0.15, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.1425, 0.04, 0.0, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0, 0.05, -0.04, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(0.015, 0.0, -0.148, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(-0.0225, 0.0, -0.15, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.1425, -0.04, 0.0, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0, -0.05, -0.04, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(0.015, 0.0, -0.148, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(-0.0225, 0.0, -0.15, 0.0, 0.0, 0.0); } } } #endif
1,267
C
36.294117
64
0.584057
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/a1_config/config/move_base/move_base_params.yaml
base_global_planner: global_planner/GlobalPlanner base_local_planner: dwa_local_planner/DWAPlannerROS shutdown_costmaps: false controller_frequency: 10.0 #5 controller_patience: 3.0 planner_frequency: 0.5 planner_patience: 5.0 oscillation_timeout: 10.0 oscillation_distance: 0.2 conservative_reset_dist: 0.1
312
YAML
19.866665
51
0.804487
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/open_quadruped_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.0915, 0.0394, 0.022, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0015, 0.045, -0.0087, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(-0.005, 0.018, -0.109, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.0, 0.0, -0.1265, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.0915, -0.0394, 0.022, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0015, -0.045, -0.0087, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(-0.005, -0.018, -0.109, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.0, 0.0, -0.1265, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.1365, 0.0394, 0.022, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0015, 0.045, -0.0087, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(-0.005, 0.018, -0.109, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(0.0, 0.0, -0.1265, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.1365, -0.0394, 0.022, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0015, -0.045, -0.0087, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(-0.005, -0.018, -0.109, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(0.0, 0.0, -0.1265, 0.0, 0.0, 0.0); } } } #endif
1,313
C
37.647058
68
0.597106
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/open_quadruped_config/include/gait_config.h
#ifndef GAIT_CONFIG_H #define GAIT_CONFIG_H #define KNEE_ORIENTATION ">>" #define PANTOGRAPH_LEG false #define ODOM_SCALER 1.15 #define MAX_LINEAR_VELOCITY_X 0.3 #define MAX_LINEAR_VELOCITY_Y 0.15 #define MAX_ANGULAR_VELOCITY_Z 1.0 #define COM_X_TRANSLATION -0.03 #define SWING_HEIGHT 0.02 #define STANCE_DEPTH 0.0 #define STANCE_DURATION 0.25 #define NOMINAL_HEIGHT 0.15 #endif
458
C
27.687498
37
0.635371
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/open_quadruped_config/config/links/links.yaml
base: base_link left_front: - front_left_hip - front_left_upper_leg - front_left_lower_leg - front_left_foot right_front: - front_right_hip - front_right_upper_leg - front_right_lower_leg - front_right_foot left_hind: - back_left_hip - back_left_upper_leg - back_left_lower_leg - back_left_foot right_hind: - back_right_hip - back_right_upper_leg - back_right_lower_leg - back_right_foot
422
YAML
16.624999
25
0.672986
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/open_quadruped_config/config/gait/gait.yaml
knee_orientation : ">>" pantograph_leg : false odom_scaler: 1.15 max_linear_velocity_x : 0.3 max_linear_velocity_y : 0.15 max_angular_velocity_z : 1.0 com_x_translation : -0.03 swing_height : 0.02 stance_depth : 0.0 stance_duration : 0.25 nominal_height : 0.15
260
YAML
22.727271
28
0.715385
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/open_quadruped_config/config/joints/joints.yaml
left_front: - motor_front_left_hip - motor_front_left_upper_leg - motor_front_left_lower_leg - front_left_leg_foot right_front: - motor_front_right_hip - motor_front_right_upper_leg - motor_front_right_lower_leg - front_right_leg_foot left_hind: - motor_back_left_hip - motor_back_left_upper_leg - motor_back_left_lower_leg - back_left_leg_foot right_hind: - motor_back_right_hip - motor_back_right_upper_leg - motor_back_right_lower_leg - back_right_leg_foot
494
YAML
20.521738
31
0.696356
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/go1_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.1881, 0.04675, 0.0, 0.0, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0, 0.08, -0.0, 0.0, 0.0, 0.0); base.lf.lower_leg.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.1881, -0.04675, 0.0, 0.0, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0, -0.08, -0.0, 0.0, 0.0, 0.0); base.rf.lower_leg.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.1881, 0.04675, 0.0, 0.0, 0.0, 0.0); base.lh.upper_leg.setOrigin(0.0, 0.08, -0.0, 0.0, 0.0, 0.0); base.lh.lower_leg.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.1881, -0.04675, 0.0, 0.0, 0.0, 0.0); base.rh.upper_leg.setOrigin(0.0, -0.08, -0.0, 0.0, 0.0, 0.0); base.rh.lower_leg.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(0.0, 0.0, -0.213, 0.0, 0.0, 0.0); } } } #endif
1,255
C
35.941175
67
0.583267
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/maps/octomap.yaml
image: octomap.pgm resolution: 0.050000 origin: [-7.500000, -14.400000, 0.0] negate: 0 occupied_thresh: 0.65 free_thresh: 0.196
129
YAML
15.249998
36
0.72093
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.117, 0.0415, 0, 0, 0, 0); base.lf.upper_leg.setOrigin(0, 0.05, -0.031, 0, 0, 0); base.lf.lower_leg.setOrigin(0.0, 0, -0.078, 0, 0, 0); base.lf.foot.setOrigin(0, 0, -0.108, 0, 0, 0); base.rf.hip.setOrigin(0.117, -0.0415, 0, 0, 0, 0); base.rf.upper_leg.setOrigin(0, -0.05, -0.031, 0, 0, 0); base.rf.lower_leg.setOrigin(0.0, 0, -0.078, 0, 0, 0); base.rf.foot.setOrigin(0, 0, -0.108, 0, 0, 0); base.lh.hip.setOrigin(-0.117, 0.0415, 0, 0, 0, 0); base.lh.upper_leg.setOrigin(0, 0.05, -0.031, 0, 0, 0); base.lh.lower_leg.setOrigin(0.0, 0, -0.078, 0, 0, 0); base.lh.foot.setOrigin(0, 0, -0.108, 0, 0, 0); base.rh.hip.setOrigin(-0.117, -0.0415, 0, 0, 0, 0); base.rh.upper_leg.setOrigin(0, -0.05, -0.031, 0, 0, 0); base.rh.lower_leg.setOrigin(0, 0, -0.078, 0, 0, 0); base.rh.foot.setOrigin(0, 0, -0.108, 0, 0, 0); } } } #endif
1,266
C
36.264705
67
0.523697
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/include/hardware_config.h
#ifndef HARDWARE_CONFIG_H #define HARDWARE_CONFIG_H // #define USE_SIMULATION_ACTUATOR #define USE_DYNAMIXEL_ACTUATOR // #define USE_SERVO_ACTUATOR // #define USE_BRUSHLESS_ACTUATOR // #define USE_SIMULATION_IMU #define USE_BNO0809DOF_IMU // #define USE_ROS #define USE_ROS_RF #ifdef USE_ROS_RF #define ELE_PIN 16 #define AIL_PIN 21 #define RUD_PIN 17 #define THR_PIN 20 #define AUX1_PIN 22 #define AUX2_PIN 23 #define RF_INV_LX false #define RF_INV_LY false #define RF_INV_AZ false #define RF_INV_ROLL true #define RF_INV_PITCH false #define RF_INV_YAW false #endif #ifdef USE_DYNAMIXEL_ACTUATOR #define LFH_SERVO_ID 16 #define LFU_SERVO_ID 17 #define LFL_SERVO_ID 18 #define RFH_SERVO_ID 14 #define RFU_SERVO_ID 7 #define RFL_SERVO_ID 4 #define LHH_SERVO_ID 2 #define LHU_SERVO_ID 11 #define LHL_SERVO_ID 12 #define RHH_SERVO_ID 6 #define RHU_SERVO_ID 5 #define RHL_SERVO_ID 8 #define LFH_INV false #define LFU_INV false #define LFL_INV true #define RFH_INV false #define RFU_INV true #define RFL_INV false #define LHH_INV false #define LHU_INV false #define LHL_INV true #define RHH_INV false #define RHU_INV true #define RHL_INV false #endif #ifdef USE_SERVO_ACTUATOR #define LFH_PIN 2 #define LFU_PIN 3 #define LFL_PIN 4 #define RFH_PIN 23 #define RFU_PIN 22 #define RFL_PIN 21 #define LHH_PIN 6 #define LHU_PIN 7 #define LHL_PIN 8 #define RHH_PIN 17 #define RHU_PIN 16 #define RHL_PIN 14 #define LFH_INV false #define LFU_INV false #define LFL_INV true #define RFH_INV false #define RFU_INV true #define RFL_INV false #define LHH_INV false #define LHU_INV false #define LHL_INV true #define RHH_INV false #define RHU_INV true #define RHL_INV false #endif #endif
1,929
C
18.693877
34
0.654743
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/include/gait_config.h
#ifndef GAIT_CONFIG_H #define GAIT_CONFIG_H #define KNEE_ORIENTATION "><" #define PANTOGRAPH_LEG false #define MAX_LINEAR_VELOCITY_X 0.20 #define MAX_LINEAR_VELOCITY_Y 0.10 #define MAX_ANGULAR_VELOCITY_Z 0.5 #define SWING_HEIGHT 0.010 #define STANCE_DEPTH 0.002 #define STANCE_DURATION 0.275 #define NOMINAL_HEIGHT 0.145 #endif
389
C
26.857141
37
0.652956
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/config/gait/gait.yaml
knee_orientation : "><" pantograph_leg : false max_linear_velocity_x : 0.20 max_linear_velocity_y : 0.10 max_angular_velocity_z : 0.5 swing_height : 0.010 stance_depth : 0.002 stance_duration : 0.275 nominal_height : 0.145
222
YAML
23.777775
28
0.725225
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/config/joints/joints.yaml
left_front: - lf_hip_joint - lf_upper_leg_joint - lf_lower_leg_joint right_front: - rf_hip_joint - rf_upper_leg_joint - rf_lower_leg_joint left_hind: - lh_hip_joint - lh_upper_leg_joint - lh_lower_leg_joint right_hind: - rh_hip_joint - rh_upper_leg_joint - rh_lower_leg_joint
302
YAML
14.947368
22
0.649007
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/config/navigation/costmap_common_params.yaml
obstacle_range: 2.5 raytrace_range: 3.0 footprint: [[-0.16, -0.12], [-0.16, 0.12], [0.16, 0.12], [0.16, -0.12]] inflation_radius: 0.55 transform_tolerance: 0.5 observation_sources: scan scan: data_type: LaserScan topic: scan marking: true clearing: true map_type: costmap
282
YAML
17.866665
71
0.673759
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/config/navigation/base_local_planner_holonomic_params.yaml
DWAPlannerROS: max_trans_vel: 0.2 min_trans_vel: 0.01 max_vel_x: 0.2 min_vel_x: -0.025 max_vel_y: 0.2 min_vel_y: -0.025 max_rot_vel: 0.5 min_rot_vel: -0.5 acc_lim_x: 0.5 acc_lim_y: 0.5 acc_lim_theta: 1.0 acc_lim_trans: 0.5 prune_plan: false xy_goal_tolerance: 0.25 yaw_goal_tolerance: 0.1 trans_stopped_vel: 0.1 rot_stopped_vel: 0.1 sim_time: 3.0 sim_granularity: 0.1 angular_sim_granularity: 0.1 path_distance_bias: 34.0 goal_distance_bias: 24.0 occdist_scale: 0.05 twirling_scale: 0.0 stop_time_buffer: 0.5 oscillation_reset_dist: 0.05 oscillation_reset_angle: 0.2 forward_point_distance: 0.3 scaling_speed: 0.25 max_scaling_factor: 0.2 vx_samples: 20 vy_samples: 0 vth_samples: 40 use_dwa: true restore_defaults: true
794
YAML
18.875
30
0.65869
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/config/navigation/move_base_params.yaml
base_global_planner: global_planner/GlobalPlanner base_local_planner: dwa_local_planner/DWAPlannerROS shutdown_costmaps: false controller_frequency: 5.0 #before 5.0 controller_patience: 3.0 planner_frequency: 0.5 planner_patience: 5.0 oscillation_timeout: 10.0 oscillation_distance: 0.2 conservative_reset_dist: 0.1 #distance from an obstacle at which it will unstuck itself cost_factor: 1.0 neutral_cost: 55 lethal_cost: 253
431
YAML
21.736841
87
0.795824
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/config/navigation/global_costmap_params.yaml
global_costmap: global_frame: map robot_base_frame: base_footprint update_frequency: 1.0 #before: 5.0 publish_frequency: 0.5 #before 0.5 static_map: true transform_tolerance: 0.5 cost_scaling_factor: 10.0 inflation_radius: 0.55
243
YAML
26.111108
36
0.72428
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/astro_config/config/navigation/local_costmap_params.yaml
local_costmap: global_frame: odom robot_base_frame: base_footprint update_frequency: 1.0 #before 5.0 publish_frequency: 2.0 #before 2.0 static_map: false rolling_window: true width: 2.5 height: 2.5 resolution: 0.05 #increase to for higher res 0.025 transform_tolerance: 0.5 cost_scaling_factor: 5 inflation_radius: 0.55
344
YAML
25.53846
52
0.715116
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spotmicro_config/config/links/links.yaml
base: base_link left_front: - front_left_shoulder_link - front_left_leg_link - front_left_foot_link - front_left_toe_link right_front: - front_right_shoulder_link - front_right_leg_link - front_right_foot_link - front_right_toe_link left_hind: - rear_left_shoulder_link - rear_left_leg_link - rear_left_foot_link - rear_left_toe_link right_hind: - rear_right_shoulder_link - rear_right_leg_link - rear_right_foot_link - rear_right_toe_link
474
YAML
18.791666
29
0.691983
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spotmicro_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: position_controllers/JointTrajectoryController joints: - front_left_shoulder - front_left_leg - front_left_foot - front_right_shoulder - front_right_leg - front_right_foot - rear_left_shoulder - rear_left_leg - rear_left_foot - rear_right_shoulder - rear_right_leg - rear_right_foot # Servomotors have inner control loops so PIDs are not needed
636
YAML
26.695651
67
0.59434
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spotmicro_config/config/ros_control/hardware.yaml
"": hardware_interface: loop_hz: 200 # hz joints: - front_left_shoulder - front_left_leg - front_left_foot - front_right_shoulder - front_right_leg - front_right_foot - rear_left_shoulder - rear_left_leg - rear_left_foot - rear_right_shoulder - rear_right_leg - rear_right_foot
387
YAML
20.555554
30
0.521964
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/spotmicro_config/config/joints/joints.yaml
left_front: - front_left_shoulder - front_left_leg - front_left_foot - front_left_toe right_front: - front_right_shoulder - front_right_leg - front_right_foot - front_right_toe left_hind: - rear_left_shoulder - rear_left_leg - rear_left_foot - rear_left_toe right_hind: - rear_right_shoulder - rear_right_leg - rear_right_foot - rear_right_toe
378
YAML
15.47826
24
0.666667
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/anymal_c_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.2999, 0.104, 0.0, 2.61799387799, 0.0, 0.0); base.lf.upper_leg.setOrigin(0.0599, 0.08381, -0.0, -2.61799387799, 0.0, 1.57079632679); base.lf.lower_leg.setOrigin(0.0, 0.1003, -0.285, 0.0, 0.0, 0.0); base.lf.foot.setOrigin(0.08795, 0.01305, -0.33797, 0.0, 0.0, -1.57079632679); base.rf.hip.setOrigin(0.2999, -0.104, 0.0, -2.61799387799, 0.0, 0.0); base.rf.upper_leg.setOrigin(0.0599, -0.08381, -0.0, 2.61799387799, 0.0, -1.57079632679); base.rf.lower_leg.setOrigin(0.0, -0.1003, -0.285, 0.0, 0.0, 0.0); base.rf.foot.setOrigin(0.08795, -0.01305, -0.33797, 0.0, 0.0, 1.57079632679); base.lh.hip.setOrigin(-0.2999, 0.104, 0.0, -2.61799387799, 0.0, -3.14159265359); base.lh.upper_leg.setOrigin(-0.0599, 0.08381, -0.0, -2.61799387799, 0.0, -1.5707963268); base.lh.lower_leg.setOrigin(0.0, 0.1003, -0.285, 0.0, 0.0, 0.0); base.lh.foot.setOrigin(-0.08795, 0.01305, -0.33797, 0.0, 0.0, -1.57079632679); base.rh.hip.setOrigin(-0.2999, -0.104, 0.0, 2.61799387799, 0.0, -3.14159265359); base.rh.upper_leg.setOrigin(-0.0599, -0.08381, -0.0, 2.61799387799, 0.0, -4.71238898038); base.rh.lower_leg.setOrigin(0.0, -0.1003, -0.285, 0.0, 0.0, 0.0); base.rh.foot.setOrigin(-0.08795, -0.01305, -0.33797, 0.0, 0.0, 1.57079632679); } } } #endif
1,521
C
43.764705
89
0.643655
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/anymal_c_config/config/links/links.yaml
base: base left_front: - LF_HIP - LF_THIGH - LF_SHANK - LF_FOOT right_front: - RF_HIP - RF_THIGH - RF_SHANK - RF_FOOT left_hind: - LH_HIP - LH_THIGH - LH_SHANK - LH_FOOT right_hind: - RH_HIP - RH_THIGH - RH_SHANK - RH_FOOT
257
YAML
9.75
12
0.560311
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/anymal_c_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 30 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - LF_HAA - LF_HFE - LF_KFE - RF_HAA - RF_HFE - RF_KFE - LH_HAA - LH_HFE - LH_KFE - RH_HAA - RH_HFE - RH_KFE gains: LF_HAA : {p: 500, i: 1, d: 30} LF_HFE : {p: 500, i: 1, d: 30} LF_KFE : {p: 500, i: 1, d: 30} RF_HAA : {p: 500, i: 1, d: 30} RF_HFE : {p: 500, i: 1, d: 30} RF_KFE : {p: 500, i: 1, d: 30} LH_HAA : {p: 500, i: 1, d: 30} LH_HFE : {p: 500, i: 1, d: 30} LH_KFE : {p: 500, i: 1, d: 30} RH_HAA : {p: 500, i: 1, d: 30} RH_HFE : {p: 500, i: 1, d: 30} RH_KFE : {p: 500, i: 1, d: 30}
927
YAML
25.514285
56
0.421791
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/anymal_c_config/config/joints/joints.yaml
left_front: - LF_HAA - LF_HFE - LF_KFE - LF_shank_fixed_LF_FOOT right_front: - RF_HAA - RF_HFE - RF_KFE - RF_shank_fixed_RF_FOOT left_hind: - LH_HAA - LH_HFE - LH_KFE - LH_shank_fixed_LH_FOOT right_hind: - RH_HAA - RH_HFE - RH_KFE - RH_shank_fixed_RH_FOOT
290
YAML
11.652173
26
0.57931
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/littledog_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - front_left_hip_roll - front_left_hip_pitch - front_left_knee - front_right_hip_roll - front_right_hip_pitch - front_right_knee - back_left_hip_roll - back_left_hip_pitch - back_left_knee - back_right_hip_roll - back_right_hip_pitch - back_right_knee gains: front_left_hip_roll : {p: 180, d: 0.9, i: 20} front_left_hip_pitch : {p: 180, d: 0.9, i: 20} front_left_knee : {p: 180, d: 0.9, i: 20} front_right_hip_roll : {p: 180, d: 0.9, i: 20} front_right_hip_pitch : {p: 180, d: 0.9, i: 20} front_right_knee : {p: 180, d: 0.9, i: 20} back_left_hip_roll : {p: 180, d: 0.9, i: 20} back_left_hip_pitch : {p: 180, d: 0.9, i: 20} back_left_knee : {p: 180, d: 0.9, i: 20} back_right_hip_roll : {p: 180, d: 0.9, i: 20} back_right_hip_pitch : {p: 180, d: 0.9, i: 20} back_right_knee : {p: 180, d: 0.9, i: 20}
1,239
YAML
34.42857
56
0.525424
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/littledog_config/config/joints/joints.yaml
left_front: - front_left_hip_roll - front_left_hip_pitch - front_left_knee - front_left_ankle right_front: - front_right_hip_roll - front_right_hip_pitch - front_right_knee - front_right_ankle left_hind: - back_left_hip_roll - back_left_hip_pitch - back_left_knee - back_left_ankle right_hind: - back_right_hip_roll - back_right_hip_pitch - back_right_knee - back_right_ankle
410
YAML
16.869564
25
0.673171
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/anymal_b_config/include/quadruped_description.h
#ifndef QUADRUPED_DESCRIPTION_H #define QUADRUPED_DESCRIPTION_H #include <quadruped_base/quadruped_base.h> namespace champ { namespace URDF { void loadFromHeader(champ::QuadrupedBase &base) { base.lf.hip.setOrigin(0.277, 0.116, 0.0, 0, 0, 0); base.lf.upper_leg.setOrigin(0.0635, 0.041, -0.0, 0, 0, 0); base.lf.lower_leg.setOrigin(0.0, 0.109, -0.25, 0, 0, 0); base.lf.foot.setOrigin(0.1, -0.02, -0.32125, 0.0, 0.0, 0.0); base.rf.hip.setOrigin(0.277, -0.116, 0.0, 0, 0, 0); base.rf.upper_leg.setOrigin(0.0635, -0.041, -0.0, 0, 0, 0); base.rf.lower_leg.setOrigin(0.0, -0.109, -0.25, 0, 0, 0); base.rf.foot.setOrigin(0.1, 0.02, -0.32125, 0.0, 0.0, 0.0); base.lh.hip.setOrigin(-0.277, 0.116, 0.0, 0, 0, 0); base.lh.upper_leg.setOrigin(-0.0635, 0.041, -0.0, 0, 0, 0); base.lh.lower_leg.setOrigin(0.0, 0.109, -0.25, 0, 0, 0); base.lh.foot.setOrigin(-0.1, -0.02, -0.32125, 0.0, 0.0, 0.0); base.rh.hip.setOrigin(-0.277, -0.116, 0.0, 0, 0, 0); base.rh.upper_leg.setOrigin(-0.0635, -0.041, -0.0, 0, 0, 0); base.rh.lower_leg.setOrigin(0.0, -0.109, -0.25, 0, 0, 0); base.rh.foot.setOrigin(-0.1, 0.02, -0.32125, 0.0, 0.0, 0.0); } } } #endif
1,211
C
34.647058
66
0.591247
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/anymal_b_config/config/ros_control/ros_control.yaml
"": joint_states_controller: type: joint_state_controller/JointStateController publish_rate: 50 joint_group_position_controller: type: effort_controllers/JointTrajectoryController joints: - LF_HAA - LF_HFE - LF_KFE - RF_HAA - RF_HFE - RF_KFE - LH_HAA - LH_HFE - LH_KFE - RH_HAA - RH_HFE - RH_KFE gains: LF_HAA : {p: 250, i: 0, d: 15} LF_HFE : {p: 250, i: 0, d: 15} LF_KFE : {p: 250, i: 0, d: 15} RF_HAA : {p: 250, i: 0, d: 15} RF_HFE : {p: 250, i: 0, d: 15} RF_KFE : {p: 250, i: 0, d: 15} LH_HAA : {p: 250, i: 0, d: 15} LH_HFE : {p: 250, i: 0, d: 15} LH_KFE : {p: 250, i: 0, d: 15} RH_HAA : {p: 250, i: 0, d: 15} RH_HFE : {p: 250, i: 0, d: 15} RH_KFE : {p: 250, i: 0, d: 15}
927
YAML
25.514285
56
0.421791
renanmb/Omniverse_legged_robotics/CHAMP-stuff/configs/anymal_b_config/config/joints/joints.yaml
left_front: - LF_HAA - LF_HFE - LF_KFE - LF_ADAPTER_TO_FOOT right_front: - RF_HAA - RF_HFE - RF_KFE - RF_ADAPTER_TO_FOOT left_hind: - LH_HAA - LH_HFE - LH_KFE - LH_ADAPTER_TO_FOOT right_hind: - RH_HAA - RH_HFE - RH_KFE - RH_ADAPTER_TO_FOOT
274
YAML
10.956521
22
0.569343
ft-lab/omniverse_sample_scripts/readme.md
# Omniverse sample scripts ここでは、NVIDIA Omniverse ( https://www.nvidia.com/ja-jp/omniverse/ ) のスクリプトのサンプルを貯めていってます。 Omniverseは、データ構造としてUSDを使用してます。 3Dモデルやシーンのファイルへの保存、読み込みでUSDが使用されるだけでなく、 Omniverse CreateやOmniverse ViewなどのOmniverseアプリのビュー上の制御もUSDを介して行われます(形状の表示/非表示の切り替えや移動など)。 ここでは、OmniverseアプリであるOmniverse CreateのScript Editorで試せるスクリプトのサンプルを用途別に列挙します。 Omniverse Create ~~2021.3.8~~ ~~2022.1.4~~ 2022.3.1(Kit.104)で確認しました。 ## 開発の参考サイト Omniverseの情報は、Omniverse Launcherがポータルになっています。 ここのLEARNにチュートリアル動画やドキュメントなどが列挙されています。 ### NVIDIA Omniverse Developer Resource Center https://developer.nvidia.com/nvidia-omniverse-developer-resource-center Omniverse開発の入口となるサイトです。 全体的に何ができて何が重要か、というのは俯瞰して見ることができます。 ### Omniverse Kit https://docs.omniverse.nvidia.com/prod_kit/prod_kit/overview.html Omniverse Kitのトップページです。 "Search API"のようなAPIからの検索もあるため、ある程度理解が進んだ方はこちらから進めるのがよいかもしれません。 ## はじめに Omniverse Createで、メインメニューの [Window] - [Script Editor]を選択して、Script Editorを起動します。 ![omniverse_script_editor_01.png](./images/omniverse_script_editor_01.png) この中でPythonを使用してプログラムを書きます。 左下のRunボタンを押すか、[Ctrl] +[Enter]キーを押すことで実行します。 以下、Pythonの初歩的な説明です。 ### コメント 1行のコメントの場合、"#"から行の末尾までがコメントになります。 ```python # comment. ``` 複数行の場合は、""" から """ までがコメントになります。 ```python """ comment. line2. """ ``` ### print デバッグ用のメッセージはprintで記載します。 ```python print('Hello Omniverse !') ``` ## 学習のための知識 * [Omniverseでの開発手段](./knowledge/dev_method.md) * [Omniverseのスクリプトの学習手順](./knowledge/dev_info.md) * [USDについての情報](./knowledge/dev_usd.md) ## Pythonの基礎的なこと |サンプル|説明| |---|---| |[Python](./Python)|Pythonの文字列処理やクラスなど。<br>Pythonの標準機能。| ## 機能説明用のサンプル |サンプル|説明| |---|---| |[Audio](./Audio)|Audioの再生| |[Animation](./Animation)|Animation関連| |[Camera](./Camera)|カメラ操作| |[Geometry](./Geometry)|ジオメトリの作成/情報取得| |[Light](./Light)|光源の作成/操作| |[Material](./Material)|マテリアルの割り当て| |[Math](./Math)|ベクトル/行列計算関連| |[Operation](./Operation)|Ominverseの操作/イベント処理| |[Event](./Event)|イベント処理| |[Physics](./Physics)|Physics(物理)処理| |[pip_archive](./pip_archive)|Pythonのよく使われるモジュールの使用| |[Prim](./Prim)|USDのPrim(ノード)の操作| |[Rendering](./Rendering)|レンダリング画像の取得| |[Scene](./Scene)|シーン(Stage)情報の取得/読み込みなど| |[Settings](./Settings)|設定の取得| |[System](./System)|システム関連情報の取得| |[UI](./UI)|UI操作| |[Post Processing](./PostProcessing)|Post Processingのパラメータを変更 (omni.kit.commands.executeを使用)| |[AssetConverter](./AssetConverter)|obj/fbx/glTFファイルなどをUSDファイルに変換| |[Nucleus](./Nucleus)|Nucleus上のファイル操作| ## プロジェクト別のサンプル |サンプル|説明| |---|---| |[PLATEAU](./PLATEAU)|Project PLATEAUの3D都市データをOmniverseに読み込み| ## ツール的なサンプル |サンプル|説明| |---|---| |[Samples](./Samples)|サンプルスクリプト| ## Extension |サンプル|説明| |---|---| |[Extensions](./Extensions)|サンプルExtension|
2,930
Markdown
23.838983
97
0.676792
ft-lab/omniverse_sample_scripts/Light/readme.md
# Light 光源を作成/取得するためのサンプルです。 ## Samples |ファイル|説明| |---|---| |[CreateLight.py](./CreateLight.py)|DistantLightを作成してパラメータを指定。| |[CreateSphereLight.py](./CreateSphereLight.py)|SphereLightを作成してパラメータを指定。| |[CheckLightPrim.py](./CheckLightPrim.py)|選択PrimがLightかどうか判断。|
298
Markdown
21.999998
78
0.667785
ft-lab/omniverse_sample_scripts/Light/CheckLightPrim.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdLux, UsdShade, Sdf, Gf, Tf # Get stage. stage = omni.usd.get_context().get_stage() # Get selection. selection = omni.usd.get_context().get_selection() paths = selection.get_selected_prim_paths() # Check if prim is Light. def checkLight (prim : Usd.Prim): typeName = prim.GetTypeName() if typeName == "DistantLight" or typeName == "CylinderLight" or \ typeName == "DiskLight" or typeName == "DomeLight" or \ typeName == "RectLight" or typeName == "SphereLight": return True return False for path in paths: # Get prim. prim = stage.GetPrimAtPath(path) if checkLight(prim): print(f"[ {prim.GetPath().pathString} ] : {prim.GetTypeName()}")
741
Python
25.499999
72
0.661269
ft-lab/omniverse_sample_scripts/Light/CreateSphereLight.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdLux, UsdShade, Sdf, Gf, Tf # Get stage. stage = omni.usd.get_context().get_stage() # Create sphere light. pathName = "/World/sphereLight" light = UsdLux.SphereLight.Define(stage, pathName) # Set Radius. light.CreateRadiusAttr(2.0) # Set intensity. light.CreateIntensityAttr(10000.0) # Set color. light.CreateColorAttr(Gf.Vec3f(1.0, 0.9, 0.8)) # Set Exposure. light.CreateExposureAttr(0.0) # cone angle. shapingAPI = UsdLux.ShapingAPI(light) shapingAPI.CreateShapingConeAngleAttr(180.0) shapingAPI.Apply(light.GetPrim()) # Register ShapingAPI as a schema in prim. # Compute extent. boundable = UsdGeom.Boundable(light.GetPrim()) extent = boundable.ComputeExtent(Usd.TimeCode(0)) # Set Extent. light.CreateExtentAttr(extent)
778
Python
22.60606
77
0.75964
ft-lab/omniverse_sample_scripts/Light/CreateLight.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdLux, UsdShade, Sdf, Gf, Tf # Get stage. stage = omni.usd.get_context().get_stage() # Create distant light. pathName = "/World/distantLight" light = UsdLux.DistantLight.Define(stage, pathName) # Set intensity. light.CreateIntensityAttr(100.0) # Set color. light.CreateColorAttr(Gf.Vec3f(1.0, 0.5, 0.2)) # Set Exposure. light.CreateExposureAttr(0.0) # Compute extent. boundable = UsdGeom.Boundable(light.GetPrim()) extent = boundable.ComputeExtent(Usd.TimeCode(0)) # Set Extent. light.CreateExtentAttr(extent)
560
Python
21.439999
71
0.75
ft-lab/omniverse_sample_scripts/Nucleus/createFolder.py
# See : https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.client/docs/index.html import asyncio import omni.client # The following should be rewritten for your environment. url = "omniverse://localhost/test/new_folder" result = omni.client.create_folder(url) if result == omni.client.Result.OK: print("success !") else: print("failed ...")
366
Python
23.466665
94
0.73224
ft-lab/omniverse_sample_scripts/Nucleus/readme.md
# Nucleus OmniverseではUSDからの保存はNucleusの指定のパス(omniverse://localhost/xxx/yyy.usd)に出力できます。 別途、Nucleus上でファイル操作を行う「omni.client」が用意されています。 ## 参考 https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.client/docs/index.html ## サンプル |ファイル|説明| |---|---| |[existPath.py](./existPath.py)|Nucleus上のファイルまたはフォルダが存在するかチェック。| |[listFiles.py](./listFiles.py)|Nucleus上の指定のフォルダ内のファイルを一覧。| |[FileCopy.py](./FileCopy.py)|ローカルからNucleus上にファイルを転送。| |[createFolder.py](./createFolder.py)|Nucleus上にフォルダを作成。| |[deleteFile.py](./deleteFile.py)|Nucleus上のファイルやフォルダを削除。| |[ReadImageFile.py](./ReadImageFile.py)|Nucleus上の画像ファイルをPIL.Imageに読み込み。|
677
Markdown
29.81818
86
0.716396
ft-lab/omniverse_sample_scripts/Nucleus/existPath.py
# See : https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.client/docs/index.html import asyncio import omni.client # Check for the existence of the specified path. async def existPath (path : str): (result, entry) = await omni.client.stat_async(path) if result == omni.client.Result.ERROR_NOT_FOUND: print("Does not exist : " + path) return print("Exist : " + path) # Awaiting results. async def _ocl_existPath (path : str): (result, entry) = await omni.client.stat_async(path) if result == omni.client.Result.ERROR_NOT_FOUND: return False return True def ocl_existPath (path : str): loop = asyncio.get_event_loop() return loop.run_until_complete(_ocl_existPath(path)) # ------------------------------------------. path1 = "omniverse://localhost/Users/test" asyncio.ensure_future(existPath(path1)) path2 = "omniverse://localhost/Users/test/xxx.usd" asyncio.ensure_future(existPath(path2)) if ocl_existPath(path1): print("Exist : " + path1) else: print("Does not exist : " + path1)
1,068
Python
27.131578
94
0.659176
ft-lab/omniverse_sample_scripts/Nucleus/listFiles.py
# See : https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.client/docs/index.html import asyncio import omni.client # Lists files in the specified path. async def listFiles (_depth : int, _path : str): (result, entries) = await omni.client.list_async(_path) if result != omni.client.Result.OK: return for entry in entries: # Skip for Channel file. if (entry.flags & omni.client.ItemFlags.IS_CHANNEL) != 0: continue name = entry.relative_path if name == "" or name.find(".") == 0: continue path = _path + "/" + name isFolder = (entry.flags & omni.client.ItemFlags.CAN_HAVE_CHILDREN) != 0 msg = "" for i in range(_depth): msg += " " if isFolder: msg += "[" + name + "]" else: msg += name msg += " " if (entry.flags & omni.client.ItemFlags.READABLE_FILE) != 0: msg += " [R]" if (entry.flags & omni.client.ItemFlags.WRITEABLE_FILE) != 0: msg += " [W]" if (entry.flags & omni.client.ItemFlags.CAN_LIVE_UPDATE) != 0: msg += " [LiveUpdate]" if not isFolder: msg += f" {entry.size} bytes" print(msg) if isFolder: await listFiles(_depth + 1, path) # -----------------------------------------------. path1 = "omniverse://localhost/Users/test" asyncio.ensure_future(listFiles(0, path1))
1,491
Python
26.127272
94
0.521797
ft-lab/omniverse_sample_scripts/Nucleus/ReadImageFile.py
# See : https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.client/docs/index.html import io import omni.client from PIL import Image result, vers, content = omni.client.read_file("omniverse://localhost/Users/test/xxx.png") if result != omni.client.Result.ERROR_NOT_FOUND: image_data = memoryview(content).tobytes() image = Image.open(io.BytesIO(image_data)) # Show Image. image.show() # Save Image. #image.save("C:\\temp\\xxx.png")
474
Python
25.388887
94
0.702532
ft-lab/omniverse_sample_scripts/Nucleus/FileCopy.py
# See : https://docs.omniverse.nvidia.com/py/kit/source/extensions/omni.client/docs/index.html import asyncio import omni.client # The following should be rewritten for your environment. srcURL = "K:\\NVIDIA_omniverse\\images\\tile_image.png" dstURL = "omniverse://localhost/test/tile_image.png" # Copy a file or folder. # When copying is complete, proceed. result = omni.client.copy(srcURL, dstURL) if result == omni.client.Result.OK: print("success !") else: print("failed ...")
493
Python
26.444443
94
0.730223
ft-lab/omniverse_sample_scripts/Physics/RayCast.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf import random import omni.physx # Get stage. stage = omni.usd.get_context().get_stage() # Y-Up. UsdGeom.SetStageUpAxis(stage, UsdGeom.Tokens.y) # Get default prim. defaultPrim = stage.GetDefaultPrim() defaultPrimPath = defaultPrim.GetPath().pathString # Physics scene definition. scene = UsdPhysics.Scene.Define(stage, defaultPrimPath + '/physicsScene') scene.CreateGravityDirectionAttr().Set(Gf.Vec3f(0.0, -1.0, 0.0)) scene.CreateGravityMagnitudeAttr().Set(981.0) # --------------------------------------------. # Create cube. # --------------------------------------------. def CreateCube (name : str, pos : Gf.Vec3f, scale : Gf.Vec3f): path = defaultPrimPath + '/cubes' prim = stage.GetPrimAtPath(path) if prim.IsValid() == False: UsdGeom.Xform.Define(stage, path) cubePath = path + '/' + name cubeGeom = UsdGeom.Cube.Define(stage, cubePath) # Set cube size. cubeGeom.CreateSizeAttr(10.0) # Set color. cubeGeom.CreateDisplayColorAttr([(0.0, 1.0, 0.0)]) # Set position. UsdGeom.XformCommonAPI(cubeGeom).SetTranslate((pos[0], pos[1], pos[2])) # Set scale. UsdGeom.XformCommonAPI(cubeGeom).SetScale((scale[0], scale[1], scale[2])) # Physics settings. cubePrim = stage.GetPrimAtPath(cubePath) UsdPhysics.CollisionAPI.Apply(cubePrim) # --------------------------------------------. # Create red sphere. # --------------------------------------------. def CreateRedSphere (name : str, pos : Gf.Vec3f, radius : float): path = defaultPrimPath + '/spheres' prim = stage.GetPrimAtPath(path) if prim.IsValid() == False: UsdGeom.Xform.Define(stage, path) spherePath = path + '/' + name sphereGeom = UsdGeom.Sphere.Define(stage, spherePath) # Set radius. sphereGeom.CreateRadiusAttr(radius) # Set color. sphereGeom.CreateDisplayColorAttr([(1.0, 0.0, 0.0)]) # Set position. UsdGeom.XformCommonAPI(sphereGeom).SetTranslate((pos[0], pos[1], pos[2])) # ------------------------------------------------------. # Create cubes. areaV = 100.0 cubeScale = 1.0 for i in range(50): posX = (random.random() - 0.5) * areaV posY = (random.random() - 0.5) * (areaV * 0.1) posZ = (random.random() - 0.5) * areaV + 100.0 pos = Gf.Vec3f(posX, posY, posZ) scale = Gf.Vec3f(cubeScale, cubeScale, cubeScale) name = 'cube_' + str(i) CreateCube(name, pos, scale) # Remove spheres. path = defaultPrimPath + '/spheres' prim = stage.GetPrimAtPath(path) if prim.IsValid(): stage.RemovePrim(path) # Callback for Rayhit. # rayhit works during animation playback. sphereIndex = 0 def ray_hit (hit): global sphereIndex print("distance : " + str(hit.distance)) print("Hit position : " + str(hit.position)) print("Hit normal : " + str(hit.normal)) print("Collision prim path : " + str(hit.collision)) # Get collision prim. prim = stage.GetPrimAtPath(hit.collision) print(" name : " + str(prim.GetName())) print("-----------------------------") # Create sphere. name = "sphere_" + str(sphereIndex) CreateRedSphere(name, hit.position, 1.0) sphereIndex += 1 for i in range(100): # Ray position. rayPos = Gf.Vec3f(0, 0, 0) # Ray direction. dx = (random.random() - 0.5) * 0.3 dy = (random.random() - 0.5) * 0.3 dz = 1.0 rayDir = Gf.Vec3f(dx, dy, dz).GetNormalized() # Ray distance. distance = 10000.0 # raycast. omni.physx.get_physx_scene_query_interface().raycast_all(rayPos, rayDir, distance, ray_hit)
3,605
Python
27.619047
95
0.605548
ft-lab/omniverse_sample_scripts/Physics/readme.md
# Physics Physicsのサンプルです。 Physicsの計算はGPU上で行われます。 PhysicsはUSDのUsdPhysics ( https://graphics.pixar.com/usd/release/api/usd_physics_page_front.html ) が使用されます。 ## Physicsデモ Physicsのデモは、Omniverse Createのメインメニューの「Window」-「Physics」-「Demo Scenes」から確認でき、Extensionとしてのソースはすべて公開されているため参考になります。 また、メインメニューの「Help」-「Physics Scripting Manual」から表示されるドキュメントに、 Physicsを使用する場合の説明がされています。 これらの情報はかなり詳しく書かれており分かりやすいですので、PhysicsについてはOmniverse Create上のPhysicsデモから学習するほうが理解が深まると思います。 ## Physicsのアニメーションが遅い場合 デフォルトでは、Physicsの剛体を配置してアニメーション再生すると重いです。 これは、アニメーション時にフレームごとにUSDを更新する書き込みが走るのが原因になります。 USD Composer 2023.2.1の場合は、Viewportの設定から Show By Type - Physics - Simulation Settings を選択。 Simulation Settingsウィンドウで"Fabric GPU"を選択します。 ![physics_settings.jpg](images/physics_settings.jpg) ## サンプル |ファイル|説明| |---|---| |[RayCast.py](./RayCast.py)|Collisionの形状を配置し、レイの始点と向きを指定して衝突判定します。<br>このRayCastはアニメーション再生中に機能します。<br>![physics_raycast_01.jpg](./images/physics_raycast_01.jpg)| |サンプル|説明| |---|---| |[simpleJoint01.py](./Joint/simpleJoint01.py)|2つのCubeをつなぐ簡単なジョイント<br>![physics_joint_01.jpg](./images/physics_joint_01.jpg)| |[simpleJoint02.py](./Joint/simpleJoint02.py)|3つのCubeをつなぐ簡単なジョイント<br>![physics_joint_02.jpg](./images/physics_joint_02.jpg)| |[rigidBody_01.py](./RigidBody/rigidBody_01.py)|RigidBodyによる簡単な自由落下<br>![physics_rigidbody_00.jpg](./images/physics_rigidbody_00.jpg)| |[rigidbody_benchmark.py](./RigidBody/rigidbody_benchmark.py)|RigidBodyによる球の自由落下。<br>たくさんの球を配置。<br>![physics_rigidbody_01.jpg](./images/physics_rigidbody_01.jpg)| |[gear_01.py](./Gear/gear_01.py)|歯車の回転。<br>アニメーション再生中に、歯車を回転させると連動します。<br>![physics_gears_01.jpg](./images/physics_gears_01.jpg)|
1,759
Markdown
46.567566
167
0.747015
ft-lab/omniverse_sample_scripts/Physics/RigidBody/rigidbody_benchmark.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf import math import random # Get stage. g_stage = omni.usd.get_context().get_stage() # Y-Up. UsdGeom.SetStageUpAxis(g_stage, UsdGeom.Tokens.y) # Physics scene definition. scene = UsdPhysics.Scene.Define(g_stage, "/physicsScene") scene.CreateGravityDirectionAttr().Set(Gf.Vec3f(0.0, -1.0, 0.0)) scene.CreateGravityMagnitudeAttr().Set(981.0) # Create Xform. g_basePath = '/World/spheres' xformPrim = UsdGeom.Xform.Define(g_stage, g_basePath) # --------------------------------------------------------. # Create ground. # --------------------------------------------------------. def createGround (): # Create cube. path = '/World/ground' cubeGeom = UsdGeom.Cube.Define(g_stage, path) # Set color. cubeGeom.CreateDisplayColorAttr([(0.2, 0.2, 0.2)]) # Set position. UsdGeom.XformCommonAPI(cubeGeom).SetTranslate((0.0, -5.0, 0.0)) # Set scale. UsdGeom.XformCommonAPI(cubeGeom).SetScale((200.0, 10, 200.0)) # Create collider. objPrim = g_stage.GetPrimAtPath(path) UsdPhysics.CollisionAPI.Apply(objPrim) # --------------------------------------------------------. # Create sphere. # @param[in] index serial number. # @param[in] radius radius of sphere. # @param[in] wPos world position (x, y, z). # @param[in] colorV color (red, green, blue). # --------------------------------------------------------. def createSphere(index, radius, wPos, colorV): # Create sphere. name = 'sphere_' + str(index) path = g_basePath + '/' + name spherePrim = UsdGeom.Sphere.Define(g_stage, path) # Set radius. spherePrim.CreateRadiusAttr(radius) # Set color. spherePrim.CreateDisplayColorAttr([colorV]) objPrim = g_stage.GetPrimAtPath(path) # Set position. UsdGeom.XformCommonAPI(spherePrim).SetTranslate(wPos) # Create collider. UsdPhysics.CollisionAPI.Apply(objPrim) UsdPhysics.MeshCollisionAPI(objPrim).CreateApproximationAttr("boundingSphere") UsdPhysics.MeshCollisionAPI.Apply(objPrim) # Rigid body. rigidBodyAPI = UsdPhysics.RigidBodyAPI.Apply(objPrim) # --------------------------------------------------------. # Create cube. # @param[in] wPos world position (x, y, z). # @param[in] wSize size (x, y, z). # --------------------------------------------------------. def createCube (index, wPos, wSize): name = 'cube_' + str(index) path = '/World/' + name cubePrim = UsdGeom.Cube.Define(g_stage, path) # Set cube size. cubePrim.CreateSizeAttr(1.0) # Set color. cubePrim.CreateDisplayColorAttr([(0.2, 0.2, 0.2)]) # Set position. UsdGeom.XformCommonAPI(cubePrim).SetTranslate((wPos[0], wPos[1], wPos[2])) # Set scale. UsdGeom.XformCommonAPI(cubePrim).SetScale((wSize[0], wSize[1], wSize[2])) # Create collider. objPrim = g_stage.GetPrimAtPath(path) UsdPhysics.CollisionAPI.Apply(objPrim) # --------------------------------------------------------. # Create wall. # --------------------------------------------------------. def createWall (): createCube(0, [-200.0, 25.0, 0.0], [ 10.0, 50.0, 400.0]) createCube(1, [ 200.0, 25.0, 0.0], [ 10.0, 50.0, 400.0]) createCube(2, [ 0.0, 25.0, -200.0], [400.0, 50.0, 10.0]) createCube(3, [ 0.0, 25.0, 200.0], [400.0, 50.0, 10.0]) # -----------------------------------------------------------. # -----------------------------------------------------------. # Create ground. createGround() # Create wall. createWall() # Create spheres. sR = 5.0 dd = 15.0 sCount = 16 dMin = dd * (float)(sCount) * 0.5 i = 0 fy = 30.0 for y in range(10): fz = -dMin for z in range(sCount): fx = -dMin for x in range(sCount): colR = random.random() colG = random.random() colB = random.random() dx = random.random() * 5.0 dz = random.random() * 5.0 createSphere(i, sR, (fx + dx, fy, fz + dz), (colR, colG, colB)) i = i + 1 fx += dd fz += dd fy += dd
4,092
Python
27.622377
82
0.536657
ft-lab/omniverse_sample_scripts/Physics/RigidBody/rigidBody_01.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf import math import random # Get stage. g_stage = omni.usd.get_context().get_stage() # Y-Up. UsdGeom.SetStageUpAxis(g_stage, UsdGeom.Tokens.y) # Physics scene definition. scene = UsdPhysics.Scene.Define(g_stage, "/physicsScene") scene.CreateGravityDirectionAttr().Set(Gf.Vec3f(0.0, -1.0, 0.0)) scene.CreateGravityMagnitudeAttr().Set(981.0) # Create Xform. g_basePath = '/World/spheres' xformPrim = UsdGeom.Xform.Define(g_stage, g_basePath) # --------------------------------------------------------. # Create ground. # --------------------------------------------------------. def createGround (): # Create cube. path = '/World/ground' cubeGeom = UsdGeom.Cube.Define(g_stage, path) # Set color. cubeGeom.CreateDisplayColorAttr([(0.2, 0.2, 0.2)]) # Set position. UsdGeom.XformCommonAPI(cubeGeom).SetTranslate((0.0, -5.0, 0.0)) # Set scale. UsdGeom.XformCommonAPI(cubeGeom).SetScale((200.0, 10, 200.0)) # Create collider. objPrim = g_stage.GetPrimAtPath(path) UsdPhysics.CollisionAPI.Apply(objPrim) # --------------------------------------------------------. # Create sphere. # @param[in] index serial number. # @param[in] radius radius of sphere. # @param[in] wPos world position (x, y, z). # @param[in] colorV color (red, green, blue). # --------------------------------------------------------. def createSphere(index, radius, wPos, colorV): # Create sphere. name = 'sphere_' + str(index) path = g_basePath + '/' + name spherePrim = UsdGeom.Sphere.Define(g_stage, path) # Set radius. spherePrim.CreateRadiusAttr(radius) # Set color. spherePrim.CreateDisplayColorAttr([colorV]) objPrim = g_stage.GetPrimAtPath(path) # Set position. UsdGeom.XformCommonAPI(spherePrim).SetTranslate(wPos) # Create collider. UsdPhysics.CollisionAPI.Apply(objPrim) UsdPhysics.MeshCollisionAPI(objPrim).CreateApproximationAttr("boundingSphere") UsdPhysics.MeshCollisionAPI.Apply(objPrim) # Rigid body. rigidBodyAPI = UsdPhysics.RigidBodyAPI.Apply(objPrim) # -----------------------------------------------------------. # -----------------------------------------------------------. # Create ground. createGround() # Create spheres. r = 100.0 sR = 10.0 rCount = 32 fV = 0.0 fVD = 2.0 * math.pi / (float)(rCount) fy = 50.0 fyD = 1.0 for i in range(200): fx = r * math.cos(fV) fz = r * math.sin(fV) colR = random.random() colG = random.random() colB = random.random() createSphere(i, sR, (fx, fy, fz), (colR, colG, colB)) fV += fVD fy += fyD if (i & 15) == 15: r *= 0.9 sR *= 0.9
2,721
Python
25.173077
82
0.574054
ft-lab/omniverse_sample_scripts/Physics/Joint/simpleJoint02.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf # Get stage. stage = omni.usd.get_context().get_stage() # Y-Up. UsdGeom.SetStageUpAxis(stage, UsdGeom.Tokens.y) rootPath = '/World' # Physics scene definition. scene = UsdPhysics.Scene.Define(stage, rootPath + '/physicsScene') scene.CreateGravityDirectionAttr().Set(Gf.Vec3f(0.0, -1.0, 0.0)) scene.CreateGravityMagnitudeAttr().Set(981.0) hPos = 15.0 # --------------------------------------------. # cube0. # --------------------------------------------. cube0Path = rootPath + '/cube0' cube0Geom = UsdGeom.Cube.Define(stage, cube0Path) # Set cube size. cube0Geom.CreateSizeAttr(10.0) # Set color. cube0Geom.CreateDisplayColorAttr([(0.0, 1.0, 0.0)]) # Set position. UsdGeom.XformCommonAPI(cube0Geom).SetTranslate((0.0, hPos, 0.0)) # Set scale. UsdGeom.XformCommonAPI(cube0Geom).SetScale((2.0, 0.5, 0.5)) # --------------------------------------------. # cube1. # --------------------------------------------. cube1Path = rootPath + '/cube1' cube1Geom = UsdGeom.Cube.Define(stage, cube1Path) # Set cube size. cube1Geom.CreateSizeAttr(10.0) # Set color. cube1Geom.CreateDisplayColorAttr([(0.0, 0.0, 1.0)]) # Set position. UsdGeom.XformCommonAPI(cube1Geom).SetTranslate((21.0, hPos, 0.0)) # Set scale. UsdGeom.XformCommonAPI(cube1Geom).SetScale((2.0, 0.5, 0.5)) # --------------------------------------------. # cube2. # --------------------------------------------. cube2Path = rootPath + '/cube2' cube2Geom = UsdGeom.Cube.Define(stage, cube2Path) # Set cube size. cube2Geom.CreateSizeAttr(10.0) # Set color. cube2Geom.CreateDisplayColorAttr([(0.0, 1.0, 1.0)]) # Set position. UsdGeom.XformCommonAPI(cube2Geom).SetTranslate((42.0, hPos, 0.0)) # Set scale. UsdGeom.XformCommonAPI(cube2Geom).SetScale((2.0, 0.5, 0.5)) # --------------------------------------------. # Physics settings. # --------------------------------------------. # cube0 : static body cube0Prim = stage.GetPrimAtPath(cube0Path) UsdPhysics.CollisionAPI.Apply(cube0Prim) # cube1 : dynamic body cube1Prim = stage.GetPrimAtPath(cube1Path) UsdPhysics.CollisionAPI.Apply(cube1Prim) UsdPhysics.RigidBodyAPI.Apply(cube1Prim) # cube2 : dynamic body cube2Prim = stage.GetPrimAtPath(cube2Path) UsdPhysics.CollisionAPI.Apply(cube2Prim) UsdPhysics.RigidBodyAPI.Apply(cube2Prim) # ----------------------------------------. # Setup joint. # ----------------------------------------. jointPath = rootPath + '/revoluteJoint' revoluteJoint = UsdPhysics.RevoluteJoint.Define(stage, jointPath) # define revolute joint axis and its limits, defined in degrees revoluteJoint.CreateAxisAttr("Z") revoluteJoint.CreateLowerLimitAttr(-50.0) revoluteJoint.CreateUpperLimitAttr(50.0) # define revolute joint bodies revoluteJoint.CreateBody0Rel().SetTargets([cube0Path]) revoluteJoint.CreateBody1Rel().SetTargets([cube1Path]) # define revolute joint local poses for bodies revoluteJoint.CreateLocalPos0Attr().Set(Gf.Vec3f(5.25, 0.0, 0.0)) revoluteJoint.CreateLocalRot0Attr().Set(Gf.Quatf(1.0)) revoluteJoint.CreateLocalPos1Attr().Set(Gf.Vec3f(-5.25, 0.0, 0.0)) revoluteJoint.CreateLocalRot1Attr().Set(Gf.Quatf(1.0)) # set break force/torque revoluteJoint.CreateBreakForceAttr().Set(1e20) revoluteJoint.CreateBreakTorqueAttr().Set(1e20) # optionally add angular drive for example angularDriveAPI = UsdPhysics.DriveAPI.Apply(stage.GetPrimAtPath(jointPath), "angular") angularDriveAPI.CreateTypeAttr("force") angularDriveAPI.CreateMaxForceAttr(100.0) angularDriveAPI.CreateTargetVelocityAttr(1.0) angularDriveAPI.CreateDampingAttr(100.0) angularDriveAPI.CreateStiffnessAttr(0.0) # ----------------------------------------. # Setup joint2. # ----------------------------------------. jointPath2 = rootPath + '/revoluteJoint2' revoluteJoint2 = UsdPhysics.RevoluteJoint.Define(stage, jointPath2) # define revolute joint axis and its limits, defined in degrees revoluteJoint2.CreateAxisAttr("Z") revoluteJoint2.CreateLowerLimitAttr(-50.0) revoluteJoint2.CreateUpperLimitAttr(50.0) # define revolute joint bodies revoluteJoint2.CreateBody0Rel().SetTargets([cube1Path]) revoluteJoint2.CreateBody1Rel().SetTargets([cube2Path]) # define revolute joint local poses for bodies revoluteJoint2.CreateLocalPos0Attr().Set(Gf.Vec3f(5.25, 0.0, 0.0)) revoluteJoint2.CreateLocalRot0Attr().Set(Gf.Quatf(1.0)) revoluteJoint2.CreateLocalPos1Attr().Set(Gf.Vec3f(-5.25, 0.0, 0.0)) revoluteJoint2.CreateLocalRot1Attr().Set(Gf.Quatf(1.0)) # set break force/torque revoluteJoint2.CreateBreakForceAttr().Set(1e20) revoluteJoint2.CreateBreakTorqueAttr().Set(1e20) # optionally add angular drive for example #angularDriveAPI2 = UsdPhysics.DriveAPI.Apply(stage.GetPrimAtPath(jointPath2), "angular") #angularDriveAPI2.CreateTypeAttr("force") #angularDriveAPI2.CreateMaxForceAttr(100.0) #angularDriveAPI2.CreateTargetVelocityAttr(1.0) #angularDriveAPI2.CreateDampingAttr(100.0) #angularDriveAPI2.CreateStiffnessAttr(0.0)
4,924
Python
30.570513
89
0.695776
ft-lab/omniverse_sample_scripts/Physics/Gear/gear_01.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf, UsdSkel, PhysxSchema import math # Get stage. g_stage = omni.usd.get_context().get_stage() # gear path. gear_basePath = '/World/gears' # Y-Up. UsdGeom.SetStageUpAxis(g_stage, UsdGeom.Tokens.y) xformCache = UsdGeom.XformCache(0) # -------------------------------------------------------. # Calculate normal. # -------------------------------------------------------. def calcTriangleNormal (v1 : Gf.Vec3d, v2 : Gf.Vec3d, v3 : Gf.Vec3d): e1 = v2 - v1 e2 = v3 - v2 e1 = Gf.Vec4f(e1[0], e1[1], e1[2],1.0) e2 = Gf.Vec4f(e2[0], e2[1], e2[2],1.0) e3 = Gf.HomogeneousCross(e1, e2) n = Gf.Vec3d(e3[0], e3[1], e3[2]) return n.GetNormalized() # -------------------------------------------------------. # Attach thickness. # @param[in] primPath Target Prim path. # @param[in] thickness Thickness. # -------------------------------------------------------. def AttachThickness (primPath : str, thickness : float): prim = g_stage.GetPrimAtPath(primPath) if prim.IsValid() == False: return if prim.GetTypeName() != 'Mesh': return m = UsdGeom.Mesh(prim) # Number of faces. faceVCouList = m.GetFaceVertexCountsAttr().Get() faceCou = len(faceVCouList) if faceCou == 0: return normalsList = m.GetNormalsAttr().Get() normalsCou = len(normalsList) if normalsCou == 0: return normalV = normalsList[0] versList = m.GetPointsAttr().Get() versCou = len(versList) if versCou < 3: return faceVIList = m.GetFaceVertexIndicesAttr().Get() faceVICou = len(faceVIList) # Stores the face number for each vertex. vFList = [[]] * (versCou) for i in range(versCou): vFList[i] = [] index = 0 for i in range(len(faceVCouList)): faceVCou = faceVCouList[i] for j in range(faceVCou): vI = faceVIList[index + j] vFList[vI].append(i) index += faceVCou faceIndicesList = [[]] * faceCou for i in range(faceCou): faceIndicesList[i] = [] # Rearrange the vertex indices per face. index = 0 for i in range(faceCou): faceVCou = faceVCouList[i] for j in range(faceVCou): faceIndicesList[i].append(faceVIList[index + j]) index += faceVCou # Create a list of independent edges. edgesList = [] for i in range(faceCou): faceVCou = faceVCouList[i] for j in range(faceVCou): vI1 = faceIndicesList[i][j] vI2 = faceIndicesList[i][(j + 1) % faceVCou] chkF = False cI = -1 for k in range(len(edgesList)): if (edgesList[k][0] == vI1 and edgesList[k][1] == vI2) or (edgesList[k][0] == vI2 and edgesList[k][1] == vI1): chkF = True cI = k break if chkF == False: edgesList.append([vI1, vI2, 1]) else: cou = edgesList[cI][2] edgesList[cI] = [vI1, vI2, cou + 1] edgesOneList = [] for p in edgesList: if p[2] == 1: edgesOneList.append([p[0], p[1]]) # Create a symmetrical face. faceVCouList2 = [0] * (faceCou * 2) normalsList2 = [(0.0, 0.0, 0.0)] * (normalsCou * 2) versList2 = [(0.0, 0.0, 0.0)] * (versCou * 2) faceVIList2 = [0] * (faceVICou * 2) for i in range(faceCou): faceVCouList2[i] = faceVCouList[i] faceVCouList2[i + faceCou] = faceVCouList[i] for i in range(faceVICou): faceVIList2[i] = faceVIList[i] faceVIList2[i + faceVICou] = faceVIList[faceVICou - i - 1] + versCou for i in range(normalsCou): normalsList2[i] = normalsList[i] normalsList2[i + normalsCou] = -normalsList[i] for i in range(versCou): versList2[i] = versList[i] n = normalsList[i] versList2[i + versCou] = versList[i] - (n * thickness) # Create side faces. vIndex = len(versList2) for edgeI in edgesOneList: e1 = edgeI[0] e2 = edgeI[1] i1 = e1 i2 = e2 i3 = e1 + versCou i4 = e2 + versCou v1 = versList2[i2] v2 = versList2[i1] v3 = versList2[i3] v4 = versList2[i4] n = calcTriangleNormal(v1, v2, v3) faceVCouList2.append(4) for j in range(4): normalsList2.append(n) versList2.append(v1) versList2.append(v2) versList2.append(v3) versList2.append(v4) for j in range(4): faceVIList2.append(vIndex + j) vIndex += 4 m.CreatePointsAttr(versList2) m.CreateNormalsAttr(normalsList2) m.CreateFaceVertexCountsAttr(faceVCouList2) m.CreateFaceVertexIndicesAttr(faceVIList2) # -------------------------------------------------------. # Create gear. # @param[in] name Prim name. # @param[in] gearR Radius of gear. # @param[in] filletCount Number of gear divisions. # @param[in] filletHeight Fillet height. # @param[in] gearWidth Gear width. # @param[in] position position. # -------------------------------------------------------. def CreateGear (name : str, gearR : float, filletCount : int, filletHeight : float, gearWidth : float, position : Gf.Vec3f): angle = 360.0 / filletCount # Angle of one tooth. # Calculate the length of one tooth on the circumference. D = (gearR * math.sin((angle / 2.0) * math.pi / 180.0)) * 2 dHalf = D * 0.5 dQuarter = D * 0.25 centerV = Gf.Vec3d(0, 0, 0) versList = [] versList.append(centerV) faceIndexList = [] maxVCou = 1 + (5 * filletCount) index = 1 aV = 0.0 for i in range(filletCount): # Vertices of a single tooth. vDirX = math.cos(aV * math.pi / 180.0) vDirY = math.sin(aV * math.pi / 180.0) v2X = -vDirY v2Y = vDirX vD = Gf.Vec3d(vDirX, vDirY, 0) vCrossD = Gf.Vec3d(v2X, v2Y, 0) vCenter = vD * gearR v1 = vCenter - (vCrossD * dHalf) v2 = v1 + (vCrossD * dQuarter) v3 = v2 + (vD * filletHeight) v4 = v3 + (vCrossD * dHalf) v5 = v4 - (vD * filletHeight) v6 = v5 + (vCrossD * dQuarter) dd = D * 0.1 vCD = vCrossD * dd v3 += vCD v4 -= vCD v2 -= vCD v5 += vCD versList.append(v1) versList.append(v2) versList.append(v3) versList.append(v4) versList.append(v5) faceIndexList.append(0) faceIndexList.append(index) faceIndexList.append(index + 1) faceIndexList.append(index + 2) faceIndexList.append(index + 3) faceIndexList.append(index + 4) if index + 5 >= maxVCou: faceIndexList.append(1) else: faceIndexList.append(index + 5) index += 5 aV += angle # Create mesh. pathName = "/World/gears" prim = g_stage.GetPrimAtPath(pathName) if prim.IsValid() == False: UsdGeom.Xform.Define(g_stage, pathName) pathMeshName0 = pathName + '/' + name pathMeshName = pathMeshName0 index = 0 while True: pathMeshName = pathMeshName0 if index > 0: pathMeshName += '_' + str(index) prim = g_stage.GetPrimAtPath(pathMeshName) if prim.IsValid() == False: break index += 1 meshGeom = UsdGeom.Mesh.Define(g_stage, pathMeshName) # Set vertices. stVersList = [] stNormalList = [] for i in range(len(versList)): stVersList.append((versList[i][0], versList[i][1], versList[i][2])) stNormalList.append((0, 0, 1)) meshGeom.CreatePointsAttr(stVersList) # Set normals. meshGeom.CreateNormalsAttr(stNormalList) # Set face vertex count. faceVCouList = [] for i in range(filletCount): faceVCouList.append(7) meshGeom.CreateFaceVertexCountsAttr(faceVCouList) # Set face vertex indices. meshGeom.CreateFaceVertexIndicesAttr(faceIndexList) # Set position. UsdGeom.XformCommonAPI(meshGeom).SetTranslate((position[0], position[1], position[2])) # Set rotation. UsdGeom.XformCommonAPI(meshGeom).SetRotate((0.0, 0.0, 0.0), UsdGeom.XformCommonAPI.RotationOrderXYZ) # Set scale. UsdGeom.XformCommonAPI(meshGeom).SetScale((1.0, 1.0, 1.0)) # Attach thickness. if gearWidth > 0.0: AttachThickness(pathMeshName, gearWidth) # ------------------------------------------ # Get prim center position. # @param[in] primPath Prim path. # @return position(Gf.Vec3f) # ------------------------------------------ def GetPrimCenter (primPath : str): prim = g_stage.GetPrimAtPath(primPath) if prim.IsValid() == False: return globalPose = xformCache.GetLocalToWorldTransform(prim) translate, rotation, scale = UsdSkel.DecomposeTransform(globalPose) return translate # ------------------------------------------ # Set RigidBody on gear. # ------------------------------------------ def SetRigidBodyOnGear (primPath : str, index : int): prim = g_stage.GetPrimAtPath(primPath) if prim.IsValid() == False: return physicsAPI = UsdPhysics.RigidBodyAPI.Apply(prim) UsdPhysics.MassAPI.Apply(prim) # Create collider. UsdPhysics.CollisionAPI.Apply(prim) UsdPhysics.MeshCollisionAPI(prim).CreateApproximationAttr("convexHull") UsdPhysics.MeshCollisionAPI.Apply(prim) pos = GetPrimCenter(primPath) # revolute joint path = gear_basePath + '/revoluteJoint_' + str(index) revoluteJoint = UsdPhysics.RevoluteJoint.Define(g_stage, path) revoluteJoint.CreateAxisAttr("Z") revoluteJoint.CreateBody1Rel().SetTargets([primPath]) revoluteJoint.CreateLocalPos0Attr().Set(pos) revoluteJoint.CreateLocalRot0Attr().Set(Gf.Quatf(1.0)) revoluteJoint.CreateLocalPos1Attr().Set(Gf.Vec3f(0.0, 0.0, 0.0)) revoluteJoint.CreateLocalRot1Attr().Set(Gf.Quatf(1.0)) # ----------------------------------------------- # Radius. radius1 = 5.0 radius2 = 10.0 radius3 = 6.25 # Create Gears. CreateGear("gear", radius1, 24, 1.0, 1.0, Gf.Vec3f(0, 0, 0)) CreateGear("gear_1", radius2, 48, 1.0, 1.0, Gf.Vec3f(16.3, 0.72, 0)) CreateGear("gear_2", radius3, 30, 1.0, 1.0, Gf.Vec3f(0.0, -12.6, 0)) # gear1 path. gear1_path = gear_basePath + '/gear' # gear2 path. gear2_path = gear_basePath + '/gear_1' # gear3 path. gear3_path = gear_basePath + '/gear_2' # Physics scene definition. scene = UsdPhysics.Scene.Define(g_stage, "/physicsScene") scene.CreateGravityDirectionAttr().Set(Gf.Vec3f(0.0, -1.0, 0.0)) scene.CreateGravityMagnitudeAttr().Set(981.0) gear1_prim = g_stage.GetPrimAtPath(gear1_path) pos1 = GetPrimCenter(gear1_path) # Set RigidBody on gear. SetRigidBodyOnGear(gear1_path, 0) SetRigidBodyOnGear(gear2_path, 1) SetRigidBodyOnGear(gear3_path, 2) # add angular drive. revolute0_path = gear_basePath + "/revoluteJoint_0" revolute1_path = gear_basePath + "/revoluteJoint_1" revolute2_path = gear_basePath + "/revoluteJoint_2" # gear joint (0-1) gearJoint = PhysxSchema.PhysxPhysicsGearJoint.Define(g_stage, gear_basePath+"/gearJoint_0_1") gearJoint.CreateBody0Rel().SetTargets([gear1_path]) gearJoint.CreateBody1Rel().SetTargets([gear2_path]) gearJoint.CreateGearRatioAttr(radius1/radius2) gearJoint.CreateHinge0Rel().SetTargets([revolute0_path]) gearJoint.CreateHinge1Rel().SetTargets([revolute1_path]) # gear joint (0-2) gearJoint2 = PhysxSchema.PhysxPhysicsGearJoint.Define(g_stage, gear_basePath+"/gearJoint_0_2") gearJoint2.CreateBody0Rel().SetTargets([gear1_path]) gearJoint2.CreateBody1Rel().SetTargets([gear3_path]) gearJoint2.CreateGearRatioAttr(radius1/radius3) gearJoint2.CreateHinge0Rel().SetTargets([revolute0_path]) gearJoint2.CreateHinge1Rel().SetTargets([revolute2_path])
11,906
Python
29.068182
126
0.589367
ft-lab/omniverse_sample_scripts/PostProcessing/readme.md
# Post Processing Post Processingの変更を行います。 Post ProcessingはOmniverse Createの「Post Processings」ウィンドウでパラメータにマウスを合わせたときのツールチップにパスが表示されています。 下記の場合は"rtx/post/lensFlares/flareScale"。 ![postprocessing_01.png](./images/postprocessing_01.png) もしくはPost Processingの値を変更してusda形式でエクスポートすると、 customLayerDataで以下のように"rtx:post: ... " というパスを確認できます。 ``` dictionary renderSettings = { bool "rtx:post:lensFlares:enabled" = 1 double "rtx:post:lensFlares:flareScale" = 0.2 double "rtx:post:tonemap:fNumber" = 4.669999895617366 token "rtx:rendermode" = "PathTracing" } ``` Pythonで以下のようにするとその値を変更できます。 ```python import omni.kit omni.kit.commands.execute("ChangeSetting", path="rtx/post/lensFlares/enabled", value=True) omni.kit.commands.execute("ChangeSetting", path="rtx/post/lensFlares/flareScale", value=0.2) ``` 「enabled」がPost Processingのその項目自身を有効/無効にする設定です。 ## サンプル |ファイル|説明| |---|---| |[ChangePostProcessing.py](./ChangePostProcessing.py)|Post Processingの"FTT Bloom"のパラメータを変更します。|
1,063
Markdown
29.399999
99
0.716839
ft-lab/omniverse_sample_scripts/PostProcessing/ChangePostProcessing.py
from pxr import Usd, UsdGeom, UsdShade, Sdf, Gf, Tf import omni.kit # Change Post Processing parameter. omni.kit.commands.execute("ChangeSetting", path="rtx/post/lensFlares/enabled", value=True) omni.kit.commands.execute("ChangeSetting", path="rtx/post/lensFlares/flareScale", value=0.2)
289
Python
40.428566
92
0.778547
ft-lab/omniverse_sample_scripts/UI/readme.md
# UI UI関連の処理を行います。 UIは「omni.ui」からアクセスすることでさまざまなウィジットを表現できます。 UIについては生成と破棄はセットになるためExtensionで実装するほうがよいですが、Script Editorからの実行でUI表示を行うこともできます(ただし、手動で破棄処理を呼ぶ必要あり)。 |サンプル|説明| |---|---| |[DebugDraw](./DebugDraw)|3Dの座標指定で、Depthによる遮蔽を考慮したラインを描画 (omni.debugdrawを使用)| |[DragAndDrop](./DragAndDrop)|UIでのドラッグ&ドロップ| |[DrawImage](./DrawImage)|スクリーンにイメージをオーバーレイして描画| |[Viewport](./Viewport)|ビューポートにオーバレイして表示| |[Window](./Window)|新しいウィンドウを表示|
479
Markdown
33.285712
103
0.709812
ft-lab/omniverse_sample_scripts/UI/DragAndDrop/readme.md
# DragAndDrop UI間のドラッグ&ドロップ。 |ファイル|説明| |---|---| |[dropTest.py](./dropTest.py)|Primをウィンドウ内のテキスト領域にドラッグすると、パスが表示される。<br>![dropTest.png](./images/dropTest.png)|
182
Markdown
17.299998
114
0.620879
ft-lab/omniverse_sample_scripts/UI/DragAndDrop/dropTest.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf import omni.ui # Create new window. my_window = omni.ui.Window("Drop test window", width=300, height=200) # ------------------------------------------. with my_window.frame: sField = None # Enable Drop. def drop_accept(url): return True # Called at Drop event. def drop (uiField, event): # prim path. vPath = event.mime_data # Get stage. stage = omni.usd.get_context().get_stage() # Get prim. if Sdf.Path(vPath): prim = stage.GetPrimAtPath(vPath) if prim.IsValid(): # Set string. uiField.model.set_value(vPath) # Create window UI. with omni.ui.VStack(height=0): with omni.ui.Placer(offset_x=8, offset_y=8): omni.ui.Label("Please drop Prim below.") with omni.ui.Placer(offset_x=8, offset_y=0): omni.ui.Spacer(height=4) with omni.ui.Placer(offset_x=8, offset_y=0): sField = omni.ui.StringField(width=240, height=14, style={"color": 0xffffffff}) sField.set_accept_drop_fn(drop_accept) sField.set_drop_fn(lambda a, w=sField: drop(w, a))
1,231
Python
27.651162
91
0.561332
ft-lab/omniverse_sample_scripts/UI/DrawImage/readme.md
# DrawImage ビューポートに画像をオーバレイ表示します。 なお、Omniverse Code(Omniverse Kit 103を使用)では、Omniverse自身のビューポートの実装が大きく進化しているようでした (2022/01/21 確認)。 そのため、おそらく以下に列挙した描画実装は将来的には不要になると思われます。 |ファイル|説明| |---|---| |[drawImage.py](./drawImage.py)|omni.ui.ByteImageProviderを使用して、RGBAバッファに描画したイメージをビューポートにオーバレイ<br>![ui_draw_image_00.png](./images/ui_draw_image_00.png)| |[drawImageWithPIL.py](./drawImageWithPIL.py)|omni.ui.ByteImageProviderを使用して、Pillow(PIL)での描画をRGBAバッファに送りビューポートにオーバレイ<br>![ui_draw_image_01.png](./images/ui_draw_image_01.png)|
558
Markdown
38.928569
180
0.740143
ft-lab/omniverse_sample_scripts/UI/DrawImage/drawImageWithPIL.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf import omni.ui import omni.kit.app import carb.events import asyncio import math import itertools # PIL exists in "kit/extscore/omni.kit.pip_archive/pip_prebundle". from PIL import Image, ImageDraw, ImageFont # Get main window viewport. window = omni.ui.Window('Viewport') # ref : omni.kit.window.images extension.py # ------------------------------------------. # Managing overlay image. # ------------------------------------------. class OverlayImageBuffer: _width = 256 _height = 256 _byte_provider = None _byte_data = None def __init__(self): self._width = 256 self._height = 256 self._byte_provider = None self._byte_data = None def startup (self, width : int, height : int): self._byte_provider = omni.ui.ByteImageProvider() self._width = width self._height = height # default format omni.ui.TextureFormat.RGBA8_UNORM. self._byte_data = [0] * (4 * self._width * self._height) self._byte_provider.set_bytes_data(self._byte_data, [self._width, self._height]) def update (self): self._byte_provider.set_bytes_data(self._byte_data, [self._width, self._height]) # ------------------------------------------. # Draw image with PIL. # ------------------------------------------. class DrawImageWithPIL: _timeCount = 0 _image = None _draw = None _overlayImageBuffer = None def __init__(self): self._image = None self._draw = None self._overlayImageBuffer = None def __del__(self): self._image = None self._draw = None def getWidth (self): return self._overlayImageBuffer._width def getHeight (self): return self._overlayImageBuffer._height def getByteProvider (self): return self._overlayImageBuffer._byte_provider def startup (self, width : int, height : int): # Create new image. self._image = Image.new("RGBA", (width, height), (0, 0, 0, 0)) self._draw = ImageDraw.Draw(self._image) self._overlayImageBuffer = OverlayImageBuffer() self._overlayImageBuffer.startup(width, height) def draw (self): # Draw rectangle (fill). self._draw.rectangle((0, 0, self._image.width, self._image.height), fill=(0, 0, 0, 0)) # Draw rectangle (fill). self._draw.rectangle((100, 100, 200, 200), fill=(255, 0, 0)) # Draw rectangle. self._draw.rectangle((100, 220, 200, 320), outline=(0, 0, 255), width=1) # Draw line. self._draw.line((0, 0, self._image.width, self._image.height), fill=(0, 255, 0), width=2) # Draw circle. self._draw.ellipse((100, 400, 150, 450), outline=(0, 0, 255), width=2) # Draw circle (fill). self._draw.ellipse((280, 300, 380, 400), fill=(0, 0, 255)) def update (self): self.draw() # Get image data(RGBA buffer). imgD = self._image.getdata() # Converting a 2d array to a 1d array. self._overlayImageBuffer._byte_data = list(itertools.chain.from_iterable(imgD)) # Update omni.ui.ByteImageProvider. self._overlayImageBuffer.update() # ------------------------------------------. # Update event. # ------------------------------------------. _drawImageWithPIL = None _img1 = None def on_update(e: carb.events.IEvent): global _drawImageWithPIL global _img1 if _drawImageWithPIL == None: _drawImageWithPIL = DrawImageWithPIL() _drawImageWithPIL.startup(512, 512) _drawImageWithPIL.update() with window.frame: with omni.ui.VStack(height=0): with omni.ui.Placer(offset_x=8, offset_y=8): _img1 = omni.ui.ImageWithProvider(_drawImageWithPIL.getByteProvider(), width=_drawImageWithPIL.getWidth(), height=_drawImageWithPIL.getHeight()) # ------------------------------------------. # Register for update events. # To clear the event, specify "subs=None". subs = omni.kit.app.get_app().get_update_event_stream().create_subscription_to_pop(on_update, name="Test update")
4,172
Python
29.459854
160
0.577421
ft-lab/omniverse_sample_scripts/UI/DrawImage/drawImage.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf import omni.ui import omni.kit.app import carb.events import asyncio import math # Get main window viewport. window = omni.ui.Window('Viewport') # ref : omni.kit.window.images extension.py # ------------------------------------------. # Managing overlay image. # ------------------------------------------. class OverlayImageBuffer: _width = 256 _height = 256 _byte_provider = None _timeCount = 0 def __init__(self): self._timeCount = 0 self._width = 512 self._height = 256 self._byte_provider = None def startup (self): self._byte_provider = omni.ui.ByteImageProvider() def update (self): # default format omni.ui.TextureFormat.RGBA8_UNORM. byte_data = [0] * (4 * self._width * self._height) for x in range(self._width): hV = 100.0 v = math.cos((float)(x + self._timeCount) * 1.2 * math.pi / 180.0) * hV iV = 128 + (int)(v) iPos = (iV * self._width + x) * 4 byte_data[iPos + 0] = 255 # Red byte_data[iPos + 1] = 255 # Green byte_data[iPos + 2] = 0 # Blue byte_data[iPos + 3] = 255 # Alpha self._byte_provider.set_bytes_data(byte_data, [self._width, self._height]) self._timeCount += 1 # ------------------------------------------. # Update event. # ------------------------------------------. _imgBuffer = None _img1 = None def on_update(e: carb.events.IEvent): global _imgBuffer global _img1 if _imgBuffer == None: _imgBuffer = OverlayImageBuffer() _imgBuffer.startup() _imgBuffer.update() with window.frame: with omni.ui.VStack(height=0): with omni.ui.Placer(offset_x=8, offset_y=8): _img1 = omni.ui.ImageWithProvider(_imgBuffer._byte_provider, width=_imgBuffer._width, height=_imgBuffer._height) _imgBuffer.update() # ------------------------------------------. # Register for update events. # To clear the event, specify "subs=None". subs = omni.kit.app.get_app().get_update_event_stream().create_subscription_to_pop(on_update, name="Test update")
2,257
Python
28.324675
128
0.530793
ft-lab/omniverse_sample_scripts/UI/DebugDraw/readme.md
# DebugDraw 3Dの座標指定で、Depthによる遮蔽を考慮したラインを描画(omni.debugdrawを使用)。 |ファイル|説明| |---|---| |[UseDebugDraw.py](./UseDebugDraw.py)|ラインを描画<br>![debugDraw_line_01.png](./images/debugDraw_line_01.png)|
214
Markdown
18.545453
110
0.64486
ft-lab/omniverse_sample_scripts/UI/DebugDraw/UseDebugDraw.py
from pxr import Usd, UsdGeom, UsdPhysics, UsdShade, Sdf, Gf, Tf import omni.ui import omni.kit.app import carb import carb.events import math from omni.debugdraw import _debugDraw _debugDraw = _debugDraw.acquire_debug_draw_interface() # --------------------------------------------. # Draw arrow. # --------------------------------------------. def drawArrow (p1, p2, color): _debugDraw.draw_line(carb.Float3(p1[0], p1[1], p1[2]), color, carb.Float3(p2[0], p2[1], p2[2]), color) P1 = Gf.Vec3f(p1[0], p1[1], p1[2]) P2 = Gf.Vec3f(p2[0], p2[1], p2[2]) vDir = P2 - P1 lenV = vDir.GetLength() vDir /= lenV v1_2 = Gf.Vec4f(vDir[0], vDir[1], vDir[2], 1.0) v2_2 = Gf.Vec4f(0, 1, 0, 1.0) v3_2 = Gf.HomogeneousCross(v1_2, v2_2) vDirX = Gf.Vec3f(v3_2[0], v3_2[1], v3_2[2]).GetNormalized() vD1 = (vDir + vDirX).GetNormalized() * (lenV * 0.1) vD2 = (vDir - vDirX).GetNormalized() * (lenV * 0.1) pp = P1 + vD1 _debugDraw.draw_line(carb.Float3(pp[0], pp[1], pp[2]), color, carb.Float3(P1[0], P1[1], P1[2]), color) pp = P1 + vD2 _debugDraw.draw_line(carb.Float3(pp[0], pp[1], pp[2]), color, carb.Float3(P1[0], P1[1], P1[2]), color) pp = P2 - vD1 _debugDraw.draw_line(carb.Float3(pp[0], pp[1], pp[2]), color, carb.Float3(P2[0], P2[1], P2[2]), color) pp = P2 - vD2 _debugDraw.draw_line(carb.Float3(pp[0], pp[1], pp[2]), color, carb.Float3(P2[0], P2[1], P2[2]), color) # ------------------------------------------. # Update event. # ------------------------------------------. def on_update(e: carb.events.IEvent): color = 0xffffc000 # AARRGGBB r = 100.0 angleD = 10.0 angleV = 0.0 px1 = 0.0 pz1 = 0.0 py1 = 0.0 for i in range(200): px2 = math.cos(angleV * math.pi / 180.0) * r pz2 = math.sin(angleV * math.pi / 180.0) * r py2 = py1 + 0.1 if i == 0: px1 = px2 pz1 = pz2 _debugDraw.draw_line(carb.Float3(px1, py1, pz1), color, carb.Float3(px2, py2, pz2), color) r -= 0.5 angleV += angleD px1 = px2 py1 = py2 pz1 = pz2 #_debugDraw.draw_point(carb.Float3(0, 30, 0), 0xffff0000) color2 = 0xffff0000 drawArrow((-100.0, 5.0, -100.0), (-100.0, 5.0, 100.0), color2) # ------------------------------------------. # Register for update events. # To clear the event, specify "subs=None". subs = omni.kit.app.get_app().get_update_event_stream().create_subscription_to_pop(on_update, name="draw update")
2,521
Python
32.18421
113
0.526378