1
0
mirror of https://gitlab.com/obbart/universal_robots_ros_driver.git synced 2026-04-10 01:50:46 +02:00

Fix velocity interface after changes in SW > 3.1.

Behaviour of t parameter in speedj command has changed and requires not to set this (optional) parameter for correct behaviour in SW > 3.1.
This commit is contained in:
Miguel Prada
2016-06-15 12:03:21 +02:00
parent 091f7c3bd0
commit e2f6e995c3

View File

@@ -98,9 +98,16 @@ void UrRealtimeCommunication::addCommandToQueue(std::string inp) {
void UrRealtimeCommunication::setSpeed(double q0, double q1, double q2, void UrRealtimeCommunication::setSpeed(double q0, double q1, double q2,
double q3, double q4, double q5, double acc) { double q3, double q4, double q5, double acc) {
char cmd[1024]; char cmd[1024];
sprintf(cmd, if( robot_state_->getVersion() >= 3.1 ) {
"speedj([%1.5f, %1.5f, %1.5f, %1.5f, %1.5f, %1.5f], %f, 0.02)\n", sprintf(cmd,
q0, q1, q2, q3, q4, q5, acc); "speedj([%1.5f, %1.5f, %1.5f, %1.5f, %1.5f, %1.5f], %f)\n",
q0, q1, q2, q3, q4, q5, acc);
}
else {
sprintf(cmd,
"speedj([%1.5f, %1.5f, %1.5f, %1.5f, %1.5f, %1.5f], %f, 0.02)\n",
q0, q1, q2, q3, q4, q5, acc);
}
addCommandToQueue((std::string) (cmd)); addCommandToQueue((std::string) (cmd));
if (q0 != 0. or q1 != 0. or q2 != 0. or q3 != 0. or q4 != 0. or q5 != 0.) { if (q0 != 0. or q1 != 0. or q2 != 0. or q3 != 0. or q4 != 0. or q5 != 0.) {
//If a joint speed is set, make sure we stop it again after some time if the user doesn't //If a joint speed is set, make sure we stop it again after some time if the user doesn't