Thread: Mecanum physics
View Single Post
  #3   Spotlight this post!  
Unread 12-06-2013, 02:37
nathan_hui nathan_hui is offline
Registered User
AKA: Nathan Hui
FRC #2473 (CHS Robotics)
Team Role: Alumni
 
Join Date: Feb 2012
Rookie Year: 2009
Location: Cupertino, CA
Posts: 228
nathan_hui will become famous soon enoughnathan_hui will become famous soon enough
Send a message via AIM to nathan_hui
Re: Mecanum physics

Doing obstacle detection and avoidance during teleop is difficult, mostly because you now need to understand the intent of the driver. What if I'm actually trying to ram someone else? (not that it would necessarily be legal).

One way to approach the problem gradually would first be to do obstacle detection. I would place an intelligent layer between the driver and the drivetrain (in the code) that would basically figure out whether or not there is an obstacle, how far the obstacle is, and whether or not the robot will hit it (if it doesn't change state in the meantime). The first and second parts aren't too bad - you simply need to query the sensors at maybe 20 Hz (Let's say the robot moves at 15 ft /s, so just under 1 ft resolution for a 20 Hz query rate. Might be a bit coarse, but you can play with the read rate later on). Once you figure out how far the obstacle is, you need to figure out what to do. The military has a system known as the Phalanx CIWS (Close In Weapons System). It does something where it looks at targets and decides whether or not to destroy it based on whether or not it can avoid the ship the CIWS is on. Your control layer needs to do something similar - can you stop the robot (or turn) so that you don't hit the obstacle? I imagine you have encoders on your drivetrain, so you should be able to generate a velocity. If you also know the dynamics of the robot (i.e. how much it takes to stop the robot safely, how much it takes to turn it around, etc.), you can code a state table that looks at the range of the obstacle, the closing velocity, and your current velocity, and figure out whether or not to turn tail, stop, or keep going (not sure why you'd want to do that, but maybe you do!).

Maybe a simpler method: if you sense something less than oh say 3 ft, freeze the drivetrain, or prevent movement in that direction. The problem with this approach is that it's nondeterministic in the result (you don't know exactly where you'll end up relative to the obstacle, and it'll be the same whether or not the obstacle is a wall or another robot.

This is starting to sound like an actual intelligent system!
__________________
Nathan Hui
B.S. Electrical Engineering, UCSD '16
FRC 2473 (CHS Robotics), Team Captain '12
FTC 4950, 6038