SmartRobotinoBatteryChargerDocking4

From RobotinoWiki

Docking coordinate system

Marker and station detection is performed in laser frame (red coordinate system). In the example below the station position is at x=1.5 and y=0.8. The station normal vector has a rotation of -178° in the laser frame. A good strategy to dock could be

  • Rotate so that the station is at (0,y)
  • Drive in y direction so that station normal vector is aligned with x axis
  • drive in x direction until distance to station is smaller than d

Irdocking-coords.png

Python interface

os << " get_bumper             - return an integer with the bumper state. 0 not pressed. 1 pressed." << std::endl;
os << " get_extpower           - return an integer with the ext_power state. 0 not connected. 1 connected." << std::endl;
os << " get_pos                - return (x,y,phi)" << std::endl;
os << " get_dist               - return (d0,...,d8) distance sensor readings in meters" << std::endl;
os << " set_vel(vx, vy, omega) - Set velocity in m/s and rad/s." << std::endl;
os << " iniData                - Get ini file parameters as json encoded string." << std::endl;
os << " get_numMarkers         - Get the number of markers found by the laser scanner. Return type int." << std::endl;
os << " get_marker(i)          - Get x,y coord of marker at index i. Return type (float,float)." << std::endl;
os << " get_markerNumScanPoints(i) - Get num scan points of marker at index i. Return type int." << std::endl;
os << " get_numStations            - Get the number of stations found by the laser scanner. Return type int." << std::endl;
os << " get_stationLeftMarker      - Get x,y coord of first station. Return type (float,float)." << std::endl;
os << " get_stationRightMarker     - Get x,y coord of right marker of first station. Return type (float,float)." << std::endl;
os << " get_stationLeftMarker      - Get x,y coord of left marker of first station. Return type (float,float)." << std::endl;
os << " get_stationPos             - Get x,y coord of first station. Return type (float,float)." << std::endl;
os << " get_stationNormal          - Get x,y coord of normal verctor of first station. Return type (float,float)." << std::endl;
os << " get_stationWidth           - Get distance between left and right marker of first station. Return type float." << std::endl;
os << std::endl;
os << "return code: 0 continue, 1 error, 2 finished docking" << std::endl;