neurogears / vestibular-vr

Closed-loop VR setup for Rancz Lab
2 stars 0 forks source link

Electrophysiology visualization and insertion workflow #22

Closed RoboDoig closed 7 months ago

RoboDoig commented 1 year ago

For visualization

For insertion

RoboDoig commented 1 year ago

This is first priority along with #19 - aim for 1st July

RoboDoig commented 10 months ago

When continuous absolute movement commands are passed to the NewScaleControl operator (e.g. hold down key press), this can result in failure to quickly reach final position command with a slow drift towards the target position.

RoboDoig commented 9 months ago

Testing in commit e69877a - missing the position + drift does not occur if movement commands only issued while motor is not running, based on return from motor status flags

RoboDoig commented 9 months ago

Discovered in commit 9fecf43 where the drift issue comes from. There is a cutoff speed parameter for the controller which determines the speed at which the manipulator will move to its target position once it is relatively close.

I think that giving movement commands in quick succession sometimes results in the manipulator not having time to decellerate to the first target position and overshooting, then being close enough to the next position that it uses the cutoff velocity to reach it rather than accelerating again.

By default, the cutoff velocity was set quite low so there ended up being what appeared to be drift in the position, but this was actually just slow movement towards the target position. I've added the ability to adjust the target speed, acceleration and cutoff speed, setting a slightly higher cutoff speed seems to get rid of the drift issue.

Right now these speeds are set on workflow inititation, but in future I'll implement a general movement command class where each movement can be set with its own speed profile - e.g. for switching between a rapid movement to home position vs. careful slow advance of a probe.

RoboDoig commented 7 months ago

Closed with #28