currently, a user can mess everything when setting a world state.
For instance joint.gvel[0] = 2. is ok, but joint.gvel = 2. is not, as it breaks the link between joint.gvel and world.gvel. The same problem occurs with joint.gpos.
maybe joint.gvel should be removed completely, as it is redundant with world.gvel. Currently, joint.gvel is used...
- in
joint.integrate(), but it could be passed as an argument to integrate.
- to set the joint initial conditions. This could be done with
world.gvel[joint.dof] = ...
- in
joint.twist, which is itself called in Body.update_dynamic(). It's less easy to remove it from there.
Note also that we do not povide a joint.gforce interface, which could be useful and seem logical as long as there is joint.gvel.
The JointsList class is an attemps to provide a nicer interface. It currently provides
joints.dof (a 1d array or a slice)
joints.gvel (a 1d array wich is a copy of the selected joints gvels)
joints.gpos (a 1d array wich is a copy of the selected joints gpos if they are 1d)
maybe the gvel and gpos should be dropped, or moved in another class (such as a per-robot one: human36, ...)).
For reference, KDL has a different approach: they have a single joint class that handles all the (1dof) joints, and which does not store the joint state at all.
currently, a user can mess everything when setting a world state.
For instance
joint.gvel[0] = 2.is ok, butjoint.gvel = 2.is not, as it breaks the link betweenjoint.gvelandworld.gvel. The same problem occurs withjoint.gpos.maybe
joint.gvelshould be removed completely, as it is redundant withworld.gvel. Currently,joint.gvelis used...joint.integrate(), but it could be passed as an argument to integrate.world.gvel[joint.dof] = ...joint.twist, which is itself called inBody.update_dynamic(). It's less easy to remove it from there.Note also that we do not povide a
joint.gforceinterface, which could be useful and seem logical as long as there isjoint.gvel.The
JointsListclass is an attemps to provide a nicer interface. It currently providesjoints.dof(a 1d array or a slice)joints.gvel(a 1d array wich is a copy of the selected joints gvels)joints.gpos(a 1d array wich is a copy of the selected joints gpos if they are 1d)maybe the
gvelandgposshould be dropped, or moved in another class (such as a per-robot one: human36, ...)).For reference, KDL has a different approach: they have a single joint class that handles all the (1dof) joints, and which does not store the joint state at all.