Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Class ICS3 Reference

Doi Yusuke edited this page Oct 21, 2016 · 25 revisions

class ICS3

ICS3 communication interface class.

methods

ICS3(const char* path, ICSBaudrate baudrate = RATE115200);

this constructor setup device for ICS3 communication. ICSBaudrate is enum on ics::ICS3. reference for more info of ICSBaudrate.

  • param:
  • path: Path of serial device.
  • baudrate: Baud rate of serial communication.
  • throw:
  • std::invalid_argument: Fail path. ex) Non tty device.
  • std::runtime_error: Fail setup task. ex) Not exist device or fail set termios.

Usage

ics::ICS3 ics("/dev/ttyUSB0", ics::ICSBaudrate::RATE115200);

Angle move(const ID &id, Angle angle) const;

Move a motor to angle. Return now angle of it.

  • param:
  • id: id of a servo motor.
  • angle: Want position.
  • return: Now angle. angle unit is the same.
  • throw: std::runtime_error: Communication error.

Usage

ics::Angle nowPos = ics.move(ID(1), Angle::newDegree(20)); // servo(id:1) move to 20°, return angle before moving.
Clone this wiki locally