Skip to content

Commit

Permalink
Merge pull request #171 from neurobionics/dev
Browse files Browse the repository at this point in the history
Merging velocity unit fix.
  • Loading branch information
senthurayyappan authored Nov 8, 2023
2 parents 001a68e + cbd1f54 commit 5953585
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion opensourceleg/hardware/actuators.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def joint_encoder_counts(self) -> int:
def motor_velocity(self) -> float:
"""Motor velocity in rad/s."""
if self._data is not None:
return float(int(self._data.mot_vel) * RAD_PER_COUNT)
return int(self._data.mot_vel) * RAD_PER_DEG
else:
return 0.0

Expand Down
2 changes: 1 addition & 1 deletion tests/test_actuators/test_dephyactpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ def test_properties_nonzero(dephyactpack_patched: DephyActpack):
assert mock_dap1.motor_position == 10 * 2 * np.pi / 16384
assert mock_dap1.motor_encoder_counts == 10
assert mock_dap1.joint_encoder_counts == 20
assert mock_dap1.motor_velocity == 10 * 2 * np.pi / 16384
assert mock_dap1.motor_velocity == 10 * np.pi / 180
assert mock_dap1.motor_acceleration == 20
assert mock_dap1.joint_position == 20 * 2 * np.pi / 16384
assert mock_dap1.joint_velocity == 10 * 2 * np.pi / 16384
Expand Down
2 changes: 1 addition & 1 deletion tests/test_joints/test_joint.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,5 +540,5 @@ def test_mockjoint_nondefaultproperties(joint_patched):
assert jp2.is_homed == True
assert jp2.encoder_map == None
assert jp2.output_position == 20 * 2 * np.pi / 16384 / 50
assert jp2.output_velocity == 10 * 2 * np.pi / 16384 / 50
assert jp2.output_velocity == 10 * np.pi / 180 / 50
assert jp2.joint_torque == 20 * 0.1133 / 1000 * 50

0 comments on commit 5953585

Please sign in to comment.