Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

Commit

Permalink
Return proper number of velocity elements
Browse files Browse the repository at this point in the history
Before, we sliced the velocity vector based on how many elements were in
the position vector, when this should actually use the number of
elements in the velocity vector.
  • Loading branch information
samuelfneumann committed Nov 2, 2021
1 parent 933389e commit 64451c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion environment/mujoco/internal/mujocoenv/MujocoEnv.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func (m *MujocoEnv) QPos() []float64 {

// QVel returns the current velocity of the model
func (m *MujocoEnv) QVel() []float64 {
return F64SliceC2Go(m.Data.qvel, m.Nq)
return F64SliceC2Go(m.Data.qvel, m.Nv)
}

// SetState sets the underlying position and velocity for the model
Expand Down

0 comments on commit 64451c7

Please sign in to comment.