mirror of
https://github.com/wassname/pyrobolearn.git
synced 2026-09-09 11:31:38 +08:00
fix bug with body states
This commit is contained in:
@@ -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
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user