positionsys camera: introduce an easy way to counter act bad mirror positioning

This allows to define each point relative to the absolute center of the field shifting each Move Setpoint by a defined user-calibrated amount
pull/1/head
EmaMaker 2021-03-01 19:00:45 +01:00
parent 2000c8be0b
commit 0aeb92ac27
2 changed files with 9 additions and 5 deletions

View File

@ -2,10 +2,14 @@
#include "systems/systems.h" #include "systems/systems.h"
//Note: those variables can be changes, and will need to change depending on camera calibration /*Camera translation: because of mechanical imprecision, the center of the camera and the center of the cone mirror may not coincide
To overcome this, each coordinate needs to be shifted by some amount, defined on a per-robot basis that needs to be recalibrated each time.
These values need to be subtracted from the coords used in setMoveSetpoints*/
#define CAMERA_TRANSLATION_X 0
#define CAMERA_TRANSLATION_Y 12
//Camera center: those setpoints correspond to the center of the field //Camera center: those setpoints correspond to what we consider the center of the field
#define CAMERA_CENTER_X -0 #define CAMERA_CENTER_X 0
#define CAMERA_CENTER_Y 0 #define CAMERA_CENTER_Y 0
//Camera goal: those setpoints correspond to the position of the center of the goal on the field //Camera goal: those setpoints correspond to the position of the center of the goal on the field

View File

@ -67,8 +67,8 @@ void PositionSysCamera::update(){
//This means the last time this is called has the biggest priority, has for prepareDrive //This means the last time this is called has the biggest priority, has for prepareDrive
void PositionSysCamera::setMoveSetpoints(int x, int y){ void PositionSysCamera::setMoveSetpoints(int x, int y){
Setpointx = x; Setpointx = x + CAMERA_TRANSLATION_X;
Setpointy = y; Setpointy = y + CAMERA_TRANSLATION_Y;
givenMovement = true; givenMovement = true;
CameraPID(); CameraPID();
} }