Merge branch 'master' into 55-table-tennis-dev
This commit is contained in:
		
						commit
						67f684cf14
					
				@ -94,14 +94,14 @@ class BlackBoxWrapper(gym.ObservationWrapper):
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        clipped_params = np.clip(action, self.traj_gen_action_space.low, self.traj_gen_action_space.high)
 | 
					        clipped_params = np.clip(action, self.traj_gen_action_space.low, self.traj_gen_action_space.high)
 | 
				
			||||||
        self.traj_gen.set_params(clipped_params)
 | 
					        self.traj_gen.set_params(clipped_params)
 | 
				
			||||||
        bc_time = np.array(0 if not self.do_replanning else self.current_traj_steps * self.dt)
 | 
					        init_time = np.array(0 if not self.do_replanning else self.current_traj_steps * self.dt)
 | 
				
			||||||
        # TODO we could think about initializing with the previous desired value in order to have a smooth transition
 | 
					        # TODO we could think about initializing with the previous desired value in order to have a smooth transition
 | 
				
			||||||
        #  at least from the planning point of view.
 | 
					        #  at least from the planning point of view.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        condition_pos = self.condition_pos if self.condition_pos is not None else self.current_pos
 | 
					        condition_pos = self.condition_pos if self.condition_pos is not None else self.current_pos
 | 
				
			||||||
        condition_vel = self.condition_vel if self.condition_vel is not None else self.current_vel
 | 
					        condition_vel = self.condition_vel if self.condition_vel is not None else self.current_vel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self.traj_gen.set_boundary_conditions(bc_time, condition_pos, condition_vel)
 | 
					        self.traj_gen.set_initial_conditions(init_time, condition_pos, condition_vel)
 | 
				
			||||||
        self.traj_gen.set_duration(duration, self.dt)
 | 
					        self.traj_gen.set_duration(duration, self.dt)
 | 
				
			||||||
        # traj_dict = self.traj_gen.get_trajs(get_pos=True, get_vel=True)
 | 
					        # traj_dict = self.traj_gen.get_trajs(get_pos=True, get_vel=True)
 | 
				
			||||||
        position = get_numpy(self.traj_gen.get_traj_pos())
 | 
					        position = get_numpy(self.traj_gen.get_traj_pos())
 | 
				
			||||||
 | 
				
			|||||||
@ -33,7 +33,7 @@ def example_mp(env_name="HoleReacherProMP-v0", seed=1, iterations=1, render=True
 | 
				
			|||||||
            # Just make sure the correct mode is set before executing the step.
 | 
					            # Just make sure the correct mode is set before executing the step.
 | 
				
			||||||
            env.render(mode="human")
 | 
					            env.render(mode="human")
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            env.render(mode=None)
 | 
					            env.render()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Now the action space is not the raw action but the parametrization of the trajectory generator,
 | 
					        # Now the action space is not the raw action but the parametrization of the trajectory generator,
 | 
				
			||||||
        # such as a ProMP
 | 
					        # such as a ProMP
 | 
				
			||||||
 | 
				
			|||||||
@ -22,7 +22,7 @@ def example_mp(env_name, seed=1, render=True):
 | 
				
			|||||||
        if render and i % 2 == 0:
 | 
					        if render and i % 2 == 0:
 | 
				
			||||||
            env.render(mode="human")
 | 
					            env.render(mode="human")
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            env.render(mode=None)
 | 
					            env.render()
 | 
				
			||||||
        ac = env.action_space.sample()
 | 
					        ac = env.action_space.sample()
 | 
				
			||||||
        obs, reward, done, info = env.step(ac)
 | 
					        obs, reward, done, info = env.step(ac)
 | 
				
			||||||
        returns += reward
 | 
					        returns += reward
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								setup.py
									
									
									
									
									
								
							@ -35,7 +35,7 @@ setup(
 | 
				
			|||||||
    extras_require=extras,
 | 
					    extras_require=extras,
 | 
				
			||||||
    install_requires=[
 | 
					    install_requires=[
 | 
				
			||||||
        'gym[mujoco]<0.25.0,>=0.24.1',
 | 
					        'gym[mujoco]<0.25.0,>=0.24.1',
 | 
				
			||||||
        'mp_pytorch @ git+https://github.com/ALRhub/MP_PyTorch.git@main'
 | 
					        'mp_pytorch<=0.1.3'
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    packages=[package for package in find_packages() if package.startswith("fancy_gym")],
 | 
					    packages=[package for package in find_packages() if package.startswith("fancy_gym")],
 | 
				
			||||||
    package_data={
 | 
					    package_data={
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user