33 if (config.
check(
"help") ==
true) {
35 yCInfo(
SERIALSERVOBOARD,
" -board NAME, where name is one of ssc32, minissc, pontech_sv203x, mondotronic_smi, parallax, pololu_usb_16servo, picopic");
77 conf.
put(
"device",
"serialport");
79 conf.
put(
"baudrate", baudrate);
80 conf.
put(
"rcvenb", 1);
81 conf.
put(
"stopbits", 2);
82 conf.
put(
"databits", 8);
83 conf.
put(
"paritymode",
"none");
144 for (
int k = 0;
k < 32;
k++) {
162 for (
int k = 0;
k < 32;
k++) {
196 for (
int k = 0;
k < 32;
k++) {
226 for (
int k = 0;
k < 32;
k++) {
293 int pos = 1500 +
round(positions[
j] * 11.11);
297 if (
FABS(speeds[
j]) < 0.1) {
298 std::snprintf(str, 80,
"#%dP%d\r",
j, pos);
300 int speed =
round(speeds[
j] * 11.11);
302 std::snprintf(str, 80,
"#%dP%dS%d\r",
j, pos, speed);
317 auto pos = (
unsigned char)((
int)(positions[
j] * 1.411) + 127);
323 cmd[1] = (
unsigned char)
j;
326 serial->
send(cmd, 3);
334 auto pos = (
unsigned char)((
int)(positions[
j] * 1.411) + 127);
338 std::snprintf(str, 80,
"BD1SV%dM%d",
j + 1, pos);
350 auto pos = (
unsigned char)((
int)(positions[
j] * 1.411) + 127);
356 cmd[1] = (
unsigned char)
j;
359 serial->
send(cmd, 3);
367 int pos = 1500 +
round(positions[
j] * 11.11);
375 cmd[3] = (
unsigned char)
j;
377 cmd[4] = (
unsigned char)(pos >> 8);
378 cmd[5] = (
unsigned char)pos;
380 serial->
send(cmd, 6);
388 int pos = 1500 +
round(positions[
j] * 11.11);
392 cmd[0] = (
int)(
j / 20) + 1;
395 cmd[2] = (
unsigned char)(pos >> 8);
396 cmd[3] = (
unsigned char)pos;
398 if (
FABS(speeds[
j]) < 0.1) {
401 auto speed = (
unsigned char)((
int)(speeds[
j] * 1.411) + 127);
406 serial->
send(cmd, 5);
define control board standard interfaces
bool movemondotronic(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movepontech(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movepicopic(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movepololu(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movessc32(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool moveminissc(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movemondotronic(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movepontech(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movepicopic(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movepololu(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool movessc32(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool moveminissc(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
bool(* move)(int j, double ref, double *positions, double *speeds, ISerialDevice *serial)
bool checkMotionDone(int j, bool *flag) override
Check if the current trajectory is terminated.
bool getRefAccelerations(double *accs) override
Get reference acceleration of all joints.
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool getAxes(int *ax) override
Get the number of controlled axes.
bool close() override
Close the DeviceDriver.
bool setRefSpeeds(const double *spds) override
Set reference speed on all joints.
bool getRefSpeeds(double *spds) override
Get reference speed of all joints.
bool setRefSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
bool open(Searchable &config) override
Open the DeviceDriver.
bool stop() override
Stop motion, multiple joints.
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool setRefAccelerations(const double *accs) override
Set reference acceleration on all joints.
bool relativeMove(int j, double delta) override
Set relative position.
bool view(T *&x)
Get an interface to the device driver.
A generic interface to serial port devices.
virtual bool send(const yarp::os::Bottle &msg)=0
Sends a string of chars to the serial communications channel.
bool close() override
Close the DeviceDriver.
bool isValid() const
Check if device is valid.
bool open(const std::string &txt)
Construct and configure a device by its common name.
A simple collection of objects that can be described and transmitted in a portable way.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
A mini-server for performing network communication in the background.
A class for storing options and configuration information.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
A base class for nested structures that can be searched.
virtual bool check(const std::string &key) const =0
Check if there exists a property of the given name.
A single value (typically within a Bottle).
#define yCInfo(component,...)
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.