ROBOTIS-GIT / OpenCR

Software for ROS Embedded board (a.k.a. OpenCR). OpenCR means Open-source Control Module for ROS.
Apache License 2.0
384 stars 238 forks source link

Use Synthiam ARC with opencr #340

Open qddxl opened 3 weeks ago

qddxl commented 3 weeks ago

After loading the EZ-OpenCR firmware from Synthiam onto OpenCR, I added the following code, but I'm still unable to read the data in ARC. Is there any way to resolve this?

define CmdGetIMUAngleData 250

cIMU IMU;

void setup() { COMMUNICATION_PORT.begin(_BAUD_RATE); IMU.begin(); }

void loop() { IMU.update(); UpdateBuffer3(); doEZProtocol(); }

void doEZProtocol() { if (IsAvail()) { byte cmd = ReadByte();

if (cmd == CmdPing) {
  // Return as a "Capability Controller"
  COMMUNICATION_PORT.write(222);
} else if (cmd == CmdGetFirmwareID) {
  Write32(_FIRMWARE_ID);
} else if (cmd is CmdGetIMUAngleData) {
  IMU.update();
  // [Your IMU angle data handling code here]
}

} }