fix bug with body states

This commit is contained in:
Brian Delhaisse
2019-06-16 21:27:26 +02:00
parent 710560e9a0
commit 2b103a5465
3 changed files with 9 additions and 4 deletions
+1 -1
View File
@@ -170,7 +170,7 @@ elif solver_flag == 1:
# set joint positions
q = q[qIdx] + dq * dt
robot.set_joint_positions(q, joint_idss=joint_ids)
robot.set_joint_positions(q, joint_ids=joint_ids)
# step in simulation
world.step(sleep_dt=dt)
+4 -1
View File
@@ -17,6 +17,8 @@ example on how to use the environment defined in `env.py`.
- a possible `figures` directory containing figures; this can include a picture of the environment, training plots,
etc.
- a possible `meshes` directory containing meshes for the different objects that are present in the environment.
- a possible `data` folder containing the parameters/hyperparameters of a pre-trained learning model, or collected
data that can be used for imitation learning for instance.
### Structure
@@ -39,7 +41,8 @@ ignore.
### Further notes
- It might be that in the future, this folder will be moved to its own repository.
- It might be that in the future, this folder will be moved to its own repository, and each paper will have its own
repository and will be loaded as submodules recursively (using `git clone --recursive`)
- I will often focus more on implementing the environments than training the various policies using the different
algorithms
- Any comments, help, pull requests are appreciated.
+4 -2
View File
@@ -52,8 +52,7 @@ class BodyState(State):
state is not a combination of states, but is given some :attr:`data`.
ticks (int): number of ticks to sleep before getting the next state data.
"""
super(BodyState, self).__init__(window_size=window_size, axis=axis, ticks=ticks)
# check given body
if not isinstance(body, (Body, int, long)):
raise TypeError("Expecting an instance of Body, or an identifier from the simulator/world, instead got: "
"{}".format(type(body)))
@@ -67,6 +66,9 @@ class BodyState(State):
body = Body(world.simulator, body)
self.body = body
# initialize parent class
super(BodyState, self).__init__(window_size=window_size, axis=axis, ticks=ticks)
@abstractmethod
def _read(self):
pass