From 2b103a5465c09d27723ae4456e35b0cf8546191a Mon Sep 17 00:00:00 2001 From: Brian Delhaisse Date: Sun, 16 Jun 2019 21:27:26 +0200 Subject: [PATCH] fix bug with body states --- examples/kinematics/inverse/ik_libraries.py | 2 +- papers/README.md | 5 ++++- pyrobolearn/states/body_states.py | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/examples/kinematics/inverse/ik_libraries.py b/examples/kinematics/inverse/ik_libraries.py index 7839b30..a736247 100644 --- a/examples/kinematics/inverse/ik_libraries.py +++ b/examples/kinematics/inverse/ik_libraries.py @@ -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) diff --git a/papers/README.md b/papers/README.md index 8a3e7a0..f72e6ca 100644 --- a/papers/README.md +++ b/papers/README.md @@ -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. diff --git a/pyrobolearn/states/body_states.py b/pyrobolearn/states/body_states.py index c219c33..c5b3a31 100644 --- a/pyrobolearn/states/body_states.py +++ b/pyrobolearn/states/body_states.py @@ -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