@@ -1752,12 +1752,16 @@ def take_action(self, action):
1752
1752
action = 104 # Whole-body goal
1753
1753
elif self .config_mobiman .action_type == 1 and self .drl_mode == "testing" and self .config_mobiman .testing_benchmark_name == "ocs2wb" :
1754
1754
if self .config_mobiman .testing_mode == 4 :
1755
+ # print("[" + self.ns + "][igibson_env_jackalJaco::iGibsonEnv::take_action] Model mode: Base")
1755
1756
action [0 ] = 0.0 # Model mode: Base
1756
1757
elif self .config_mobiman .testing_mode == 5 :
1758
+ # print("[" + self.ns + "][igibson_env_jackalJaco::iGibsonEnv::take_action] Model mode: Arm")
1757
1759
action [0 ] = 0.5 # Model mode: Arm
1758
1760
else :
1761
+ # print("[" + self.ns + "][igibson_env_jackalJaco::iGibsonEnv::take_action] Model mode: Whole-body")
1759
1762
action [0 ] = 1.0 # Model mode: Whole-body
1760
1763
action [1 ] = 1.0 # Target mode: Goal
1764
+ # print(f"[{self.ns}][igibson_env_jackalJaco::iGibsonEnv::take_action] action[1]: {action[1]}")
1761
1765
1762
1766
self .step_action = action
1763
1767
self .current_step += 1
@@ -2750,15 +2754,15 @@ def initialize_testing_domain(self):
2750
2754
testing_range_agent1_pos_y_max = 0.0
2751
2755
testing_range_agent1_n_points_y = 2
2752
2756
2753
- elif self .config_mobiman .testing_mode == 4 and self .config_mobiman .testing_mode == 5 :
2757
+ elif self .config_mobiman .testing_mode == 4 or self .config_mobiman .testing_mode == 5 :
2754
2758
2755
2759
## Parameters for robot pose
2756
2760
testing_range_robot_pos_x_min = 0.0
2757
2761
testing_range_robot_pos_x_max = 0.0
2758
2762
testing_range_robot_n_points_x = 1
2759
2763
2760
- testing_range_robot_pos_y_min = 2 .0
2761
- testing_range_robot_pos_y_max = 2 .0
2764
+ testing_range_robot_pos_y_min = - 1 .0
2765
+ testing_range_robot_pos_y_max = - 1 .0
2762
2766
testing_range_robot_n_points_y = 1
2763
2767
2764
2768
testing_range_robot_yaw_min = 0.0 # -0.5 * math.pi
@@ -2794,13 +2798,13 @@ def initialize_testing_domain(self):
2794
2798
testing_range_box_n_points_y = 1
2795
2799
testing_range_box_n_points_z = 1
2796
2800
2801
+ else :
2802
+ print ("[" + self .ns + "][igibson_env_jackalJaco::iGibsonEnv::initialize_testing_domain] ERROR :Invalid testing_mode: " + str (self .config_mobiman .testing_mode ) + str ("!" ))
2803
+
2797
2804
# print("[" + self.ns + "][igibson_env_jackalJaco::iGibsonEnv::initialize_testing_domain] DEBUG_INF")
2798
2805
# while 1:
2799
2806
# continue
2800
2807
2801
- else :
2802
- print ("[" + self .ns + "][igibson_env_jackalJaco::iGibsonEnv::initialize_testing_domain] ERROR :Invalid testing_mode: " + str (self .config_mobiman .testing_mode ) + str ("!" ))
2803
-
2804
2808
## Initialize robot pose configurations
2805
2809
robot_pos_x_lin = np .linspace (testing_range_robot_pos_x_min , testing_range_robot_pos_x_max , testing_range_robot_n_points_x )
2806
2810
robot_pos_y_lin = np .linspace (testing_range_robot_pos_y_min , testing_range_robot_pos_y_max , testing_range_robot_n_points_y )
@@ -2855,8 +2859,16 @@ def initialize_testing_domain(self):
2855
2859
box_pos_x_mesh .flatten (), box_pos_y_mesh .flatten (), box_pos_z_mesh .flatten (),
2856
2860
agent0_pos_x_mesh .flatten (), agent0_pos_y_mesh .flatten (),
2857
2861
agent1_pos_x_mesh .flatten (), agent1_pos_y_mesh .flatten ()))
2862
+
2863
+ elif self .config_mobiman .testing_mode == 4 :
2864
+ ## Format: [robot_pos_x, robot_pos_y, robot_yaw, box_pos_x, box_pos_y, box_pos_z]
2865
+ robot_pos_x_mesh , robot_pos_y_mesh , robot_pos_theta , box_pos_x_mesh , box_pos_y_mesh , box_pos_z_mesh = np .meshgrid (robot_pos_x_lin , robot_pos_y_lin , yaw_lin ,
2866
+ box_pos_x_lin , box_pos_y_lin , box_pos_z_lin )
2858
2867
2859
- if self .config_mobiman .testing_mode == 6 :
2868
+ self .testing_samples = np .column_stack ((robot_pos_x_mesh .flatten (), robot_pos_y_mesh .flatten (), robot_pos_theta .flatten (),
2869
+ box_pos_x_mesh .flatten (), box_pos_y_mesh .flatten (), box_pos_z_mesh .flatten ()))
2870
+
2871
+ elif self .config_mobiman .testing_mode == 6 :
2860
2872
## Format: [robot_pos_x, robot_pos_y, robot_yaw, box_pos_x, box_pos_y, box_pos_z]
2861
2873
robot_pos_x_mesh , robot_pos_y_mesh , robot_pos_theta , box_pos_x_mesh , box_pos_y_mesh , box_pos_z_mesh = np .meshgrid (robot_pos_x_lin , robot_pos_y_lin , yaw_lin ,
2862
2874
box_pos_x_lin , box_pos_y_lin , box_pos_z_lin )
@@ -4156,7 +4168,7 @@ def save_oar_data(self):
4156
4168
self .oars_data ['testing_state' ].append (self .testing_samples [self .testing_idx ])
4157
4169
self .oars_data ['testing_eval_index' ].append (self .testing_eval_idx )
4158
4170
4159
- print ("[" + self .ns + "][igibson_env_jackalJaco::iGibsonEnv::save_oar_data] testing result: " + str (self .termination_reason ))
4171
+ # print("[" + self.ns + "][igibson_env_jackalJaco::iGibsonEnv::save_oar_data] testing result: " + str(self.termination_reason))
4160
4172
4161
4173
if self .episode_done :
4162
4174
self .oars_data ['log_file' ].append ("" )
0 commit comments