Go to Post Thank you FIRST -- thank you, thank you, thank you -- I can't say that enough. We can't say that enough.... Its too bad that more of us don't try. - Aidan F. Browne [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-01-2017, 08:49
AriMindell AriMindell is online now
Registered User
FRC #1389 (The Body Electric)
Team Role: Programmer
 
Join Date: May 2016
Rookie Year: 2015
Location: Maryland
Posts: 28
AriMindell will become famous soon enoughAriMindell will become famous soon enough
Optical mouse for mecanum Odometry?

We are working on finding ways to calculate robot pose for a mecanum drive. Many of the papers I have found on this subject use optic flow sensors or cameras to watch changes in the ground. Could we use a Computer mouse with an optical sensor to calculate the position of our robot?

What would our limitations be using this method?

Does the roborio support Human Interface Devices plugged into the USB ports?

We are a Java team, and I wonder if we could use the JInput library on the Roborio to get the position of the mouse.

Any thoughts on this are greatly appreciated!
EDIT:
The mouse would only be used for translation. We would use a gyro to track robot turns, and transform our coordinate system to continue tracking the mouse translation.

Last edited by AriMindell : 10-01-2017 at 09:48.
Reply With Quote
  #2   Spotlight this post!  
Unread 10-01-2017, 08:58
engunneer's Avatar
engunneer engunneer is offline
Alumni turned Mentor
AKA: Branden Gunn
FRC #4761
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 1996
Location: Reading, MA
Posts: 879
engunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond reputeengunneer has a reputation beyond repute
Re: Optical mouse for mecanum Odometry?

it probably would show up as a device. you probably need a gaming mouse to make sure you don't get velocity limits. Optical mice can't tell you rotation, so you would nee 2 mice to get full information. Reading carpet may be tricky.
__________________
Student FRC23 (1996-1999), Mentor FRC246 (2000), Mentor FRC1318 (2007-2009), Mentor FRC93 (2011), Mentor FRC2151 (2012), Mentor FRC23 (2013), Mentor FRC4761 (2014-2017)
1998 - National Chairman's Award and Woodie Flowers Award (FRC23, Mike Bastoni ) | 2007 - PNW SF (488, 1595) | 2008 - Oregon RCA - Seattle #2 Seed, SF (488, 1696) | 2009 - Oregon #1 Seed, Winners (1983, 2635) - Seattle SF (945, 2865) - Galileo #2 Seed, SF (973, 25) | 2012 Midwest F (111, 71) | 2014 RIDE Winners (78, 125), Inspector - NEU #24, QF (3479, 3958) - NECMP #35 | 2015 Reading #11, SF (1058, 190), Inspector - RIDE #17, QF(4055, 5494), Inspector - NECMP #57 | 2016 Reading #4, SF (133, 4474), DCA, Inspector - Ride #22, SF (1735, 2067), Creativity, Inspector - NECMP #48, RCA - Archimedes
Reply With Quote
  #3   Spotlight this post!  
Unread 10-01-2017, 09:27
cad321 cad321 is offline
Jack of all trades, Master of none
AKA: Brian Wagg
FRC #2386 (Trojans)
Team Role: Alumni
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Burlington, Ontario
Posts: 350
cad321 is just really nicecad321 is just really nicecad321 is just really nicecad321 is just really nice
Re: Optical mouse for mecanum Odometry?

https://www.chiefdelphi.com/forums/s...=Optical+mouse

Just going to leave this here
Reply With Quote
  #4   Spotlight this post!  
Unread 10-01-2017, 09:28
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is online now
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 413
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: Optical mouse for mecanum Odometry?

There have been multiple previous threads on this subject, and I think the consensus tended to be that it is possible, with the right mouse (mice) and spacing from the floor. In this case, what is keeping you from using a gyro and/or encoders?
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #5   Spotlight this post!  
Unread 10-01-2017, 09:36
AriMindell AriMindell is online now
Registered User
FRC #1389 (The Body Electric)
Team Role: Programmer
 
Join Date: May 2016
Rookie Year: 2015
Location: Maryland
Posts: 28
AriMindell will become famous soon enoughAriMindell will become famous soon enough
Quote:
Originally Posted by Poseidon5817 View Post
what is keeping you from using a gyro and/or encoders?

We want accurate X/Y position of our mecanum drive, and research told me that encoders are not accurate enough with mecanum wheels due to slipping of casters.
In addition, I think that you cannot determine your current position independent of time with just the encoder positions for mecanum, since it matters what combination of velocities you have each timestep.
That said, we are planning to use a gyro for heading. The mouse would only be for translation.



Sent from my iPhone using Tapatalk
Reply With Quote
  #6   Spotlight this post!  
Unread 10-01-2017, 09:40
Poseidon5817's Avatar
Poseidon5817 Poseidon5817 is online now
Founder and CEO, DeadMemes Studios
AKA: Mitchel Stokes
FRC #5817 (Uni-Rex)
Team Role: Mentor
 
Join Date: Aug 2013
Rookie Year: 2014
Location: Clovis, CA
Posts: 413
Poseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud ofPoseidon5817 has much to be proud of
Re: Optical mouse for mecanum Odometry?

Quote:
Originally Posted by AriMindell View Post
We want accurate X/Y position of our mecanum drive, and research told me that encoders are not accurate enough with mecanum wheels due to slipping of casters.
In addition, I think that you cannot determine your current position independent of time with just the encoder positions for mecanum, since it matters what combination of velocities you have each timestep.
That said, we are planning to use a gyro for heading. The mouse would only be for translation.



Sent from my iPhone using Tapatalk
You can determine your position independent of time, as encoders can tell you both the position and velocity of the bot at any given time. That being said, I cannot speak to the accuracy of encoders with mecanum wheels, but I imagine that it could be feasible depending on how it is implemented.
__________________
My FRC History:

2014 - Team 1671: Central Valley Regional Finalist and Chairman's Award Winner, Sacramento Regional Finalist, Archimedes Quarterfinalist
2015 - Team 1671: Central Valley Regional Semifinalist, Sacramento Regional Semifinalist and Chairman's Award Winner, Newton Winner, Einstein Winner
2016 - Team 5817: Central Valley Regional Finalist and Rookie All-Star, Orange County Regional Quarterfinalist and Rookie All-Star, Newton Division
2017 - Team 5817: Return of the bench grinder


Reply With Quote
  #7   Spotlight this post!  
Unread 10-01-2017, 09:42
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,127
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: Optical mouse for mecanum Odometry?

Quote:
Originally Posted by AriMindell View Post
Could we use a Computer mouse with an optical sensor to calculate the position of our [mecanum] robot?!
Using only a single optical mouse, with no additional sensors, consider the following scenario:

1) drive forward 5 feet

2) rotate in-place around the mouse 180 degrees

3) drive forward another 5 feet

... what is the position of the robot according to the mouse?



[EDIT this info was not in your original post:

Quote:
That said, we are planning to use a gyro for heading. The mouse would only be for translation.


Last edited by Ether : 10-01-2017 at 09:44.
Reply With Quote
  #8   Spotlight this post!  
Unread 10-01-2017, 09:42
Hitchhiker 42's Avatar
Hitchhiker 42 Hitchhiker 42 is offline
Roboter
AKA: Mark Lavrentyev
FRC #4557 (FullMetal Falcons)
Team Role: Programmer
 
Join Date: Oct 2015
Rookie Year: 2015
Location: Cromwell, CT
Posts: 529
Hitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond reputeHitchhiker 42 has a reputation beyond repute
Re: Optical mouse for mecanum Odometry?

Quote:
Originally Posted by AriMindell View Post
We want accurate X/Y position of our mecanum drive, and research told me that encoders are not accurate enough with mecanum wheels due to slipping of casters.
Why not go with accelerometers? Those don't depend on slipping.
__________________



2016 - NE District Championship Entrepreneurship Award
2016 - Hartford District Industrial Design Award
2016 - Waterbury District Engineering Inspiration Award
Reply With Quote
  #9   Spotlight this post!  
Unread 10-01-2017, 09:46
MrRoboSteve MrRoboSteve is offline
Mentor
AKA: Steve Peterson
FRC #3081 (Kennedy RoboEagles)
Team Role: Mentor
 
Join Date: Mar 2012
Rookie Year: 2011
Location: Bloomington, MN
Posts: 582
MrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond reputeMrRoboSteve has a reputation beyond repute
Re: Optical mouse for mecanum Odometry?

You should be more specific about your positioning requirements. It's one thing to calculate position during an autonomous routine (a la Ether's description above), and another thing to know your position 45 seconds into the match.

If you're talking an autonomous scenario, you can use motion profiling to control acceleration and manage wheel slip.
__________________
2016-17 events: 10000 Lakes Regional, Northern Lights Regional, FTC Burnsville Qualifying Tournament

2011 - present · FRC 3081 Kennedy RoboEagles mentor
2013 - present · event volunteer at 10000 Lakes Regional, Northern Lights Regional, North Star Regional, Lake Superior Regional, Minnesota State Tournament, PNW District 4 Glacier Peak, MN FTC, CMP
http://twitter.com/MrRoboSteve · www.linkedin.com/in/speterson
Reply With Quote
  #10   Spotlight this post!  
Unread 10-01-2017, 09:46
AriMindell AriMindell is online now
Registered User
FRC #1389 (The Body Electric)
Team Role: Programmer
 
Join Date: May 2016
Rookie Year: 2015
Location: Maryland
Posts: 28
AriMindell will become famous soon enoughAriMindell will become famous soon enough
Quote:
Originally Posted by Hitchhiker 42 View Post
Why not go with accelerometers? Those don't depend on slipping.


Correct me if I'm wrong, but I believe that accelerometers are pretty bad at tracking velocity or position, because the two integrations result in a massive amount of noise.


Sent from my iPhone using Tapatalk
Reply With Quote
  #11   Spotlight this post!  
Unread 10-01-2017, 11:58
StevenB StevenB is offline
is having FRC withdrawal symptoms.
AKA: Steven Bell
no team
Team Role: College Student
 
Join Date: May 2005
Rookie Year: 2005
Location: Stanford, CA
Posts: 416
StevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond reputeStevenB has a reputation beyond repute
Re: Optical mouse for mecanum Odometry?

Six years ago I wrote a paper on using optical mice for robot odometry, and as far as I know it's still the most comprehensive review of this topic. While we built a system that worked fairly well for our senior design project, I don't recommend mice for FRC. For one thing, acquiring mice that you can easily interface with and building an appropriate lighting and lens system is a bit tricky (although I'm happy to help if you want to try). The mice often have huge errors in their measurements, because the readings are highly dependent on the surface quality, illumination, distance to the surface, and focus of the lens. For example, while the measurements may be repeatable on carpet, you'll get very different results on the gaffer's tape delineating the various zones on the field. In our system, we did a least-squares fit with six mouse sensors to estimate the position and orientation of the robot.

I've attached my paper if you'd like to read more.
Attached Files
File Type: pdf paper_stevenbell_18mar11.pdf (1.03 MB, 15 views)
__________________
Need a physics refresher? Want to know if that motor is big enough for your arm? A FIRST Encounter with Physics

2005-2007: Student | Team #1519, Mechanical Mayhem | Milford, NH
2008-2011: Mentor | Team #2359, RoboLobos | Edmond, OK
2014-??: Mentor | Looking for a team...
Reply With Quote
  #12   Spotlight this post!  
Unread 10-01-2017, 12:01
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,082
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Optical mouse for mecanum Odometry?

Quote:
Originally Posted by AriMindell View Post
Correct me if I'm wrong, but I believe that accelerometers are pretty bad at tracking velocity or position, because the two integrations result in a massive amount of noise.
That's correct. You can typically obtain a position estimate for a wheeled mobile robot much more reliably through other means.

Typically the biggest challenge with using an optical mouse for position is that they are designed to glide over a smooth surface at a very precise height. You will almost certainly need some sort of suspension, and even that may not be enough for guaranteeing you don't lose track when traversing bumps and seams in the carpet. (EDIT: StephenB's post goes into more detail).

I wouldn't give up totally on using encoders on mecanum wheels for positioning. Although the rollers on the perimeters can spin freely, any movement in x, y, or theta will result in proportional rotation on a sensed axle (assuming your rollers may have rotated, but have not lost traction). However, unlike determining the necessary wheel speeds for a mecanum drive to achieve a given x, y, theta velocity (inverse kinematics), taking 4 independent velocity measurements and obtaining an x, y, theta velocity (forward kinematics) has 4 inputs and 3 unknowns; it is an overdetermined system. Due to noise you are virtually guaranteed not to have measured 4 velocities that exactly solve the equations. One common approach to deal with this is to use a least-squares solution, which would find 4 new velocities that are consistent and minimize the mean square "error" between what you measured and what your kinematic model says is possible. (A nice side effect is that you can measure this error - "residual" - and use it as a signal that you might be less certain about the vehicle's motion and could be colliding with something, etc.).

Alternatively, going back to the optical mouse idea, you could make something that is more similar to a ball mouse:

You don't even need a ball; two passive omniwheels mounted at right angles and connected to encoders could give you unambiguous X and Y measurements, even if your mecanum wheels have lost traction. As in the optical mouse case you are gonna want some sort of simple suspension to deal with irregularities in the carpet, but omniwheels at least have no trouble reliably rolling over typical imperfections in FRC field surfaces.
Reply With Quote
  #13   Spotlight this post!  
Unread 10-01-2017, 12:22
AriMindell AriMindell is online now
Registered User
FRC #1389 (The Body Electric)
Team Role: Programmer
 
Join Date: May 2016
Rookie Year: 2015
Location: Maryland
Posts: 28
AriMindell will become famous soon enoughAriMindell will become famous soon enough
Quote:
Originally Posted by Jared Russell View Post

Due to noise you are virtually guaranteed not to have measured 4 velocities that exactly solve the equations. One common approach to deal with this is to use a least-squares solution, which would find 4 new velocities that are consistent and minimize the mean square "error" between what you measured and what your kinematic model says is possible. (A nice side effect is that you can measure this error - "residual" - and use it as a signal that you might be less certain about the vehicle's motion and could be colliding with something, etc.).
This is definitely an interesting approach. I will update this post once we do some more testing and decide which method we're going to use. Thanks!




Sent from my iPhone using Tapatalk
Reply With Quote
  #14   Spotlight this post!  
Unread 10-01-2017, 12:25
Kaleb Dodd's Avatar
Kaleb Dodd Kaleb Dodd is offline
Registered User
FRC #1114 (Simbotics)
Team Role: Programmer
 
Join Date: Dec 2014
Rookie Year: 2013
Location: St.Catharines, Ontario, Canada
Posts: 6
Kaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond reputeKaleb Dodd has a reputation beyond repute
Re: Optical mouse for mecanum Odometry?

In 2015 we experimented with using a mouse to track position for our kiwi drive but we found that even with a gaming mouse that had a fast refresh rate we still couldn't get accurate distance measurements when driving on the field. We ended up using an encoder on each wheel and a gyro to track our x,y position on the field but we had to be careful and not accelerate too fast or the wheels would slip and we would lose our position. A mecanum drive would also have similar problems with wheels slipping so you might want to implement some acceleration control or for a quick solution just slowly ramp up the power when you first start moving which is what we did in our 2015 code posted here https://www.chiefdelphi.com/media/papers/3180?
Reply With Quote
  #15   Spotlight this post!  
Unread 10-01-2017, 12:43
jwhite jwhite is offline
Registered User
FRC #2823
Team Role: Mentor
 
Join Date: Feb 2013
Rookie Year: 2013
Location: Saint Paul, MN
Posts: 69
jwhite is an unknown quantity at this point
Re: Optical mouse for mecanum Odometry?

Not a direct answer to your question, but I found this thread quite informative on this subject:

https://www.chiefdelphi.com/forums/s...d.php?t=132758

with what looked like a very clever suggestion from Ether on this.

(But I couldn't track down the thread with the 'homework' Ether assigned in 2014, which I bet would also be interesting).
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 20:46.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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