mirror of
https://github.com/apirrone/Open_Duck_Mini_Runtime.git
synced 2025-09-02 19:23:54 +00:00
stuff
This commit is contained in:
parent
de99f07477
commit
8433892a20
1 changed files with 8 additions and 6 deletions
|
@ -129,6 +129,7 @@ class RLWalk:
|
||||||
print("IMU data is None, skipping observation retrieval")
|
print("IMU data is None, skipping observation retrieval")
|
||||||
return None
|
return None
|
||||||
gravity = np.array(imu_data["orientation"]).reshape((3, 3)).T @ np.array([0, 0, -1])
|
gravity = np.array(imu_data["orientation"]).reshape((3, 3)).T @ np.array([0, 0, -1])
|
||||||
|
# accelero = np.array(imu_data["accelero"])
|
||||||
gyro = imu_data["gyro"]
|
gyro = imu_data["gyro"]
|
||||||
|
|
||||||
dof_pos = self.hwi.get_present_positions(
|
dof_pos = self.hwi.get_present_positions(
|
||||||
|
@ -162,6 +163,7 @@ class RLWalk:
|
||||||
|
|
||||||
obs = np.concatenate(
|
obs = np.concatenate(
|
||||||
[
|
[
|
||||||
|
# accelero,
|
||||||
gyro,
|
gyro,
|
||||||
gravity,
|
gravity,
|
||||||
cmds,
|
cmds,
|
||||||
|
@ -261,12 +263,12 @@ class RLWalk:
|
||||||
if obs is None:
|
if obs is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if np.linalg.norm(self.last_commands[:3]) > 0.1:
|
# if np.linalg.norm(self.last_commands[:3]) > 0.1:
|
||||||
self.imitation_i += 1 * (
|
self.imitation_i += 1 * (
|
||||||
self.phase_frequency_factor + self.phase_frequency_factor_offset
|
self.phase_frequency_factor + self.phase_frequency_factor_offset
|
||||||
)
|
)
|
||||||
else:
|
# else:
|
||||||
self.imitation_i = 0
|
# self.imitation_i = 0
|
||||||
self.imitation_i = self.imitation_i % self.PRM.nb_steps_in_period
|
self.imitation_i = self.imitation_i % self.PRM.nb_steps_in_period
|
||||||
self.imitation_phase = np.array(
|
self.imitation_phase = np.array(
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in a new issue