Team2890HawkCollective / 2023-Sensors

2023 Season FRC Robot code for Team 2890 - The Hawk Collective - Seraph
Other
0 stars 0 forks source link

Deposit Positioning #3

Open gavinjalberghini opened 1 year ago

gavinjalberghini commented 1 year ago

Problem: Placing the bot in the correct position to place game pieces.

Possible Sensors:

Possible Solutions:

NerdyDragon777 commented 1 year ago

Some links to post before in-depth research begins. Stage one.

https://raceon.io/localization/ https://stackoverflow.com/questions/67925438/how-can-i-estimate-the-pose-of-an-object-with-tags-attached-and-always-display https://github.com/AprilRobotics/apriltag_ros/issues/28 https://april.eecs.umich.edu/software/apriltag https://github.com/AprilRobotics/apriltag/wiki/AprilTag-User-Guide#pose-estimation

NerdyDragon777 commented 1 year ago

AI Written psuedocode. (May be correct or incorrect, it is just an outline of what to possibly expect)

float distance = 5.0; // distance to align robot from April tag in units

// detect April tag TagData tagData = detectTag();

// determine position and orientation of April tag float tagX = tagData.getX(); float tagY = tagData.getY(); float tagTheta = tagData.getTheta();

// calculate target position for robot float targetX = tagX + distancecos(tagTheta); float targetY = tagY + distancesin(tagTheta);

// rotate robot to face target position rotateTo(targetX, targetY);

// move robot to target position moveTo(targetX, targetY);