Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   I got it to work! USB mice (http://www.chiefdelphi.com/forums/showthread.php?t=134948)

Altainia 19-02-2015 23:35

I got it to work! USB mice
 
It has come full circle. Years ago I joined this forum as a student with the sole goal to learn how to get optical mice to work with the microcontroller we had at the time. Now, seven years later and back on board as a mentor, (and with the new roboRIO having USB ports) I can finally say I GOT IT!

So here's a video tutorial I made. I included links to the necessary files in the dooblydoo.

https://www.youtube.com/watch?v=Aup6CQv_-j4

tomy 20-02-2015 00:07

Re: I got it to work! USB mice
 
Very interesting. The idea to use a wireless mouse to control the robot, correct? Am I correct to assume this wouldn't be for competition use.

Altainia 20-02-2015 01:13

Re: I got it to work! USB mice
 
No. It's to put a hardwired optical mouse on the robot for position tracking.

tomy 20-02-2015 01:17

Re: I got it to work! USB mice
 
I'm assuming the mouse would read the carpet then as move around. Then using the equation you stated you could tell how far away you are from your starting position?

Altainia 20-02-2015 01:40

Re: I got it to work! USB mice
 
Exactly.

tomy 20-02-2015 12:26

Re: I got it to work! USB mice
 
So it reads in pixels then you'd divid it by your dpi. How accurate is it?

Arhowk 20-02-2015 12:46

Re: I got it to work! USB mice
 
Quote:

Originally Posted by tomy (Post 1447646)
How accurate is it?

I'd also like to know... In my experience most mouse only maintain about 95% accuracy (meaning that the same motion repeated an infinite number of times will have a 5% deviance in delta distance). At the start of the season I expected to integrate the accelerometer to obtain velocity, but it's noise is horrendous. If the mouse gets good data, than it might be a good option.

Also, whats the issue with
Code:

MouseInfo.getPointerInfo().getLocation().x

tomy 20-02-2015 12:54

Re: I got it to work! USB mice
 
This would be used to replace the gyro then? How close to the ground does the mouse have to be?

JesseK 20-02-2015 15:31

Re: I got it to work! USB mice
 
This is a pretty awesome achievement. Position this guy at the center of rotation, and the measurement is very precise. Do you know if it works on the HDPE surface of the scoring platform? I know mice tend to go crazy if used on glass, or sometimes even an overly-polished conference room table.

Altainia 20-02-2015 16:08

Re: I got it to work! USB mice
 
Quote:

Originally Posted by Arhowk (Post 1447660)
I'd also like to know... In my experience most mouse only maintain about 95% accuracy (meaning that the same motion repeated an infinite number of times will have a 5% deviance in delta distance). At the start of the season I expected to integrate the accelerometer to obtain velocity, but it's noise is horrendous. If the mouse gets good data, than it might be a good option.

I don't yet know how accurate it is. We are printing a plastic board to hold the circuitry to better mount it on a practice bot. I'll update this thread with how well it works once we know. However, the manufacturer claims it can detect speeds up to 10 feet/sec and has a resolution of 1000 pixels per inch. When leaving it stationary on carpet similar to competition carpet, it had an error of about 1 pixel (or 1/1000 in) every five minutes. This was not rigorously tested.

Quote:

Also, whats the issue with
Code:

MouseInfo.getPointerInfo().getLocation().x

Two issues: first, that requires a screen to be set up as the pointer only exists with a display. That would have been possible to do (set up a dummy XServer on the roboRIO) but you would have to constantly reset the pointer's position each time you got its location as once it reaches the end of the imaginary screen, it wouldn't go any further. That was something I was prepared to do as well if this didn't pan out, but getting the raw data seemed more elegant to me.

Quote:

Originally Posted by tomy (Post 1447663)
This would be used to replace the gyro then? How close to the ground does the mouse have to be?

One mouse could not replace the gyro as it only measures linear distance. However, two mice (and there are two USB ports) could replace the gyro. That is our intention if this ends up working reliably (see above). As far as distance to the ground, pretty close. It's a gaming mouse, so it was designed to not register anything if it's more than even a quarter of an inch off the ground (so that a gamer could move the mouse forward for a game and pick it up to reset it on their mouse pad without redacting the action they just made in game), so we're using a smooth and curve-ended plastic board for it to slide on with springs holding it to the ground. The springs will hopefully allow it to slide up the ramps.

Quote:

Originally Posted by JesseK (Post 1447758)
This is a pretty awesome achievement. Position this guy at the center of rotation, and the measurement is very precise. Do you know if it works on the HDPE surface of the scoring platform? I know mice tend to go crazy if used on glass, or sometimes even an overly-polished conference room table.

Putting it at the center of rotation does not need to be done if two mice are used to get actual rotation. However, lining them up along the robot's x and y axis will be the challenge, considering the resolution this mouse has...
I do not know if it will work on the scoring platform. All it needs is imperfections on the surface at least 1/500th of an inch for it to work. Even if not, the main purpose of this was to drive precisely in auto, and we can just tell it to go around.

Arhowk 20-02-2015 18:49

Re: I got it to work! USB mice
 
hm. The only issue I see is sensor distance. I have a laser mouse with me ATM and I can only hover it ~1cm above the mousepad for it to pick up, any higher and the cursor doesn't move. How far above the carpet does your team plan to mount your mouse? My biggest fear would be chipping the mouse when going over the bump

Altainia 20-02-2015 23:16

Re: I got it to work! USB mice
 
Quote:

Originally Posted by Arhowk (Post 1447851)
hm. The only issue I see is sensor distance. I have a laser mouse with me ATM and I can only hover it ~1cm above the mousepad for it to pick up, any higher and the cursor doesn't move. How far above the carpet does your team plan to mount your mouse? My biggest fear would be chipping the mouse when going over the bump

We're making a custom base for the mouse's circuitry to rest on and using springs to keep it to the ground while allowing it to rise up on the bump. It also cannot be too far from the ground. Also, we're using an optical mouse, though that doesn't matter too much.

sraque 07-10-2015 12:24

Re: I got it to work! USB mice
 
We are looking at options for tracking position ahead of next build season. Can you share how you physically mounted the mouse (pics), and any performance information you gained this season (how well it worked)?

Thanks!

Altainia 10-10-2015 00:21

Re: I got it to work! USB mice
 
Quote:

Originally Posted by sraque (Post 1498996)
We are looking at options for tracking position ahead of next build season. Can you share how you physically mounted the mouse (pics), and any performance information you gained this season (how well it worked)?

Thanks!

Unfortunately, we never got around to it. Too much got in the way. I hope to try it for this coming year, though, as we still have all the parts.

I still do intend to update this thread with any information once we have it

GuyM142 14-10-2015 09:28

Re: I got it to work! USB mice
 
This would be useful in the coming season!
Correct me if I'm wrong, in order to use an optical mouse to track the robot's position it has to be centered around the rotation axis of the robot, otherwise it will sense rotation in place as a change in the robot's position.


All times are GMT -5. The time now is 17:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi