hardware/gantry_controller.h¶
Physical coordinate translation and G-code generation.
22" physical rail travel
<—————————-—> |
|---|
+-+ +———————+ +-+ |
| |B| | | |W|| | |L| | 12” board | |H||
| |A| | | |I||
| |C| | 8x8 grid | |T||
| |K| | | |E||
| +-+ +———————+ +-+|
| 3.0” .5” 12” .5” 3.0” | |<———- 19” occupied width ——-—>|
^ ^
| |
Black captures White captures
X = 1.5”, 3.0” X = 17.5”, 19.0”
Y = 4.420” to 14.920” Y = 4.420” to 14.920”
-
namespace Gantry
Enums
-
enum StartingSlot¶
Values:
-
enumerator SLOT_R1¶
-
enumerator SLOT_R2¶
-
enumerator SLOT_B1¶
-
enumerator SLOT_B2¶
-
enumerator SLOT_N1¶
-
enumerator SLOT_N2¶
-
enumerator SLOT_Q¶
-
enumerator SLOT_K¶
-
enumerator SLOT_P1¶
-
enumerator SLOT_P2¶
-
enumerator SLOT_P3¶
-
enumerator SLOT_P4¶
-
enumerator SLOT_P5¶
-
enumerator SLOT_P6¶
-
enumerator SLOT_P7¶
-
enumerator SLOT_P8¶
-
enumerator SLOT_R1¶
Variables
-
constexpr double RAIL_TRAVEL = 18.0¶
-
constexpr double BOARD_SIZE = 12.0¶
-
constexpr double SQUARE_SIZE = 1.5¶
-
constexpr double BOARD_MARGIN = 3.0¶
-
constexpr double A1_CENTER_X = 5.000¶
-
constexpr double A1_CENTER_Y = 4.420¶
-
constexpr double CAPTURE_VERTICAL_SPACING = 1.5¶
-
constexpr double CAPTURE_HORIZONTAL_SPACING = 1.5¶
-
constexpr double WHITE_CAPTURE_COL1_X = 17.500¶
-
constexpr double WHITE_CAPTURE_COL2_X = 19.000¶
-
constexpr double BLACK_CAPTURE_COL1_X = 3.000¶
-
constexpr double BLACK_CAPTURE_COL2_X = 1.500¶
-
constexpr double CAPTURE_START_Y = A1_CENTER_Y¶
-
constexpr double FEED_RATE = 1000.0¶
-
struct GcodeObserver¶
- #include <gantry_controller.h>
-
class GrblController¶
- #include <gantry_controller.h>
Public Functions
-
GrblController()¶
-
~GrblController()¶
-
bool connect(const char *port, int baudRate = 115200)¶
-
void disconnect()¶
-
inline bool isConnected() const¶
-
void enableDryRun()¶
Enable dry-run mode: no serial port is required. Every G-code command that would be sent to GRBL is printed to stdout instead. The full planning and G-code generation pipeline runs normally so you can audit every command before powering the gantry.
Call this instead of connect() when you have no hardware attached.
-
inline bool isDryRun() const¶
-
bool sendCommand(const std::string &cmd)¶
-
bool sendCommands(const std::vector<std::string> &cmds)¶
-
bool home()¶
-
bool executeCapture(const BoardCoord &square, bool isWhitePiece, StartingSlot slot)¶
-
bool setupNewGame()¶
-
bool moveTo(const BoardCoord &coord)¶
-
bool setMagnet(bool on)¶
-
inline bool isMagnetEngaged() const¶
-
GrblCapabilities probeCapabilities()¶
-
bool writeSetting(int number, double value)¶
-
bool applyMotionProfile(const MotionProfile &profile)¶
-
inline void setMotionProfile(const MotionProfile &profile)¶
-
inline const MotionProfile &getMotionProfile() const¶
-
inline void setGcodeObserver(const GcodeObserver &observer)¶
-
GrblController()¶
-
enum StartingSlot¶