Skip to content

Commit c942e18

Browse files
committed
Bug #19: fix motors target being present position when robot is
compliant
1 parent 9392497 commit c942e18

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Packages/ReachySimulator/Scripts/ReachyController.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,10 @@ void Update()
161161
if (!m.name.StartsWith("neck"))
162162
{
163163
JointController joint = m.gameObject.GetComponent<JointController>();
164-
joint.RotateTo(m.targetPosition);
164+
if (m.isCompliant)
165+
joint.RotateTo(m.presentPosition);
166+
else
167+
joint.RotateTo(m.targetPosition);
165168
joint.IsCompliant(m.isCompliant);
166169

167170
m.presentPosition = joint.GetPresentPosition();

0 commit comments

Comments
 (0)