mayacakmak / se2

Control interfaces for manipulating SE2 configurations
BSD 2-Clause "Simplified" License
1 stars 0 forks source link

Panel click interface #12

Closed mayacakmak closed 4 years ago

mayacakmak commented 4 years ago

The panel interface was implemented to support clicks (single small move of the object) as well as press-hold-release (for longer continuous moves). The latter is used much more than the former. A click-based alternative to that is that when the arrow is clicked once, the object starts moving; when it is clicked again, it stops moving. Should be reasonable to implement following the template of the other interfaces, but will require some re-discovery.

kavidey commented 4 years ago

A basic version of this is implemented. It can be accessed by selecting Panel click interface in demo.html, or adding this to the end of any interface URL: ?c=4&t=1. These are working links to the test and practice pages.

panel_control.js already had a built-in handler for click events, but it just translated/rotated the ee by a few pixels per click. I modified it to emit [press, release]-[left, right, up, down, cw, ccw] events. When a user clicks on any arrow, it toggles that arrow to on and the EE begins translating or rotating respectively. The EE continues until either, the same arrow is pressed again (at which point it stops), or a different arrow is pressed (which causes the EE to switch to move based on the new arrow).

For the press/release transitions, the EE had built-in acceleration to help decrease movement time. I kept this for the click transitions, but I found it to be a bit hard to control because the EE is naturally moving for longer periods of time and accelerating more, making it harder to stop in the desired location. We might want to decrease the maximum speed when using the click interface, or even disable acceleration all together and increase the base speed of the EE.

csemecu commented 4 years ago

I agree with Kavi! I tested out on the practice page and it feels like the object becomes a little out of control when it accelerates. We might want to change the speed value to a lower one and keep the acceleration first, and if it still feels unreliable maybe discard the acceleration part

kavidey commented 4 years ago

I update the interface with new acceleration and maximum speed values. It is definitely a bit easier to control. I do still need to sometimes move in the same direction twice because I overshot or undershot the target, but I think overall its much easier control.

mayacakmak commented 4 years ago

This parameter setting seems to work well. I also overshot or stopped early and did a few mini-movements to hit exact targets, but I think it is a good tradeoff point (versus having it be too slow and wait forever to get somewhere).