13 bool To_string( System::String^ source, std::string &target ) {
14 int len = (( source->Length+1) * 2);
15 char *ch =
new char[ len ];
18 pin_ptr<const wchar_t> wch = PtrToStringChars( source );
19 result = wcstombs( ch, wch, len ) != -1;
33 Katana::Katana(System::String ^ipAddress, System::String ^configurationFile) :
35 std::string ip, portno, configFile;
46 }
catch(std::exception &e) {
74 }
catch(std::exception &e) {
81 array<int> ^
encoders =
gcnew array<int>(encodersVec.size());
84 }
catch(std::exception &e) {
87 for(
unsigned int i = 0; i < encodersVec.size(); ++i) {
88 encoders[i] = encodersVec[i];
96 encoderVector[i] = encoders[i];
100 }
catch(std::exception &e) {
108 }
catch(std::exception &e) {
114 std::vector<double> coordinateVector(6,0);
128 array<double> ^coordinates =
gcnew array<double>(6);
129 for(
unsigned int i = 0; i < 6; ++i) {
130 coordinates[i] = coordinateVector[i];
136 std::vector<double> coordinateVector(6, 0);
137 for(
unsigned int i = 0; i < 6; ++i) {
138 coordinateVector[i] = coordinates[i];
142 }
catch(std::exception &e) {
148 std::vector<double> coordinateVector(6, 0);
149 for(
unsigned int i = 0; i < 6; ++i) {
150 coordinateVector[i] = coordinates[i];
154 }
catch(std::exception &e) {
178 }
catch(std::exception &e) {
186 }
catch(std::exception &e) {
194 }
catch(std::exception &e) {
201 }
catch(std::exception &e) {
213 }
catch(std::exception &e) {
237 }
catch(std::exception &e) {
245 }
catch(std::exception &e) {
253 }
catch(std::exception &e) {
261 }
catch(std::exception &e) {
269 }
catch(std::exception &e) {
277 }
catch(std::exception &e) {
285 }
catch(std::exception &e) {
293 }
catch(std::exception &e) {
void switchMotorOff(int number)
void freezeMotor(short number)
void moveRobotToEnc(array< int >^encoders, bool waitUntilReached, int waitTimeout)
void setCrashLimit(long idx, int limit)
unblock robot after a crash
bool To_string(System::String^source, std::string &target)
void moveRobotLinearTo(double x, double y, double z, double phi, double theta, double psi, bool waitUntilReached=true, int waitTimeout=TM_ENDLESS)
void setMotorVelocityLimit(int number, int velocity)
Implement the Serial-Zero protocol.
void freezeMotor(int number)
void openGripper(bool waitUntilReached=false, int waitTimeout=100)
void switchMotorOff(short number)
void openGripper(bool waitUntilReached, int waitTimeout)
void setActivatePositionController(bool activate)
array< double > getCoordinates(bool refreshEncoders)
void switchMotorOn(int number)
void getCoordinates(double &x, double &y, double &z, double &phi, double &theta, double &psi, bool refreshEncoders=true)
void setActivatePositionController(bool activate)
bool getActivatePositionController()
Check if the position controller will be activated after the linear movement.
int getMotorEncoders(short number, bool refreshEncoders=true) const
void disableCollisionLimits()
void setMaximumLinearVelocity(double maximumVelocity)
void moveMotorToEnc(int motor, int encoder, bool waitUntilReached, int waitTimeout)
void setCollisionLimit(int number, int limit)
Encapsulates the socket communication device.
Katana(System::String^ipAddress, System::String^configurationFile)
void moveRobotLinearTo(array< double >^coordinates, bool waitUntilReached, int waitTimeout)
void enableCollisionLimits()
array< int > getRobotEncoders(bool refreshEncoders)
int getMotorAccelerationLimit(int number)
short getMotorVelocityLimit(short number) const
void setMaximumLinearVelocity(double maximumVelocity)
std::vector< int >::iterator getRobotEncoders(std::vector< int >::iterator start, std::vector< int >::const_iterator end, bool refreshEncoders=true) const
int getMotorEncoders(int number, bool refreshEncoders)
void unBlock()
unblock robot after a crash
void closeGripper(bool waitUntilReached=false, int waitTimeout=100)
void switchMotorOn(short number)
void closeGripper(bool waitUntilReached, int waitTimeout)
void setMotorAccelerationLimit(short number, short acceleration)
void create(const char *configurationFile, CCplBase *protocol)
Create routine.
double getMaximumLinearVelocity() const
void setMotorVelocityLimit(short number, short velocity)
void moveRobotTo(double x, double y, double z, double phi, double theta, double psi, bool waitUntilReached=true, int waitTimeout=TM_ENDLESS)
const char * what() const
short getNumberOfMotors() const
bool getActivatePositionController()
void setMotorAccelerationLimit(int number, int acceleration)
void moveRobotTo(array< double >^coordinates, bool waitUntilReached, int waitTimeout)
double getMaximumLinearVelocity()
void moveRobotToEnc(std::vector< int >::const_iterator start, std::vector< int >::const_iterator end, bool waitUntilReached=false, int encTolerance=100, int waitTimeout=0)
void enableCrashLimits()
crash limits enable
std::vector< int > encoders
void disableCrashLimits()
crash limits disable
int getMotorVelocityLimit(int number)
void moveMotorToEnc(short number, int encoders, bool waitUntilReached=false, int encTolerance=100, int waitTimeout=0)
short getMotorAccelerationLimit(short number) const