mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 01:50:46 +02:00
Bugfixes in URScript commands
This commit is contained in:
@@ -86,7 +86,7 @@ void UrDriver::addTraj(std::vector<double> inp_timestamps,
|
|||||||
timestamps[i] - timestamps[i - 1]);
|
timestamps[i] - timestamps[i - 1]);
|
||||||
command_string += buf;
|
command_string += buf;
|
||||||
}
|
}
|
||||||
command_string += "end\ntraj()\n";
|
command_string += "end\n";
|
||||||
//printf("%s", command_string.c_str());
|
//printf("%s", command_string.c_str());
|
||||||
rt_interface_->addCommandToQueue(command_string);
|
rt_interface_->addCommandToQueue(command_string);
|
||||||
|
|
||||||
@@ -123,14 +123,14 @@ void UrDriver::setJointNames(std::vector<std::string> jn) {
|
|||||||
void UrDriver::setToolVoltage(unsigned int v) {
|
void UrDriver::setToolVoltage(unsigned int v) {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, "sec setOut():\n\tset_tool_voltage(%d)\nend\n", v);
|
sprintf(buf, "sec setOut():\n\tset_tool_voltage(%d)\nend\n", v);
|
||||||
printf("%s", buf);
|
//printf("%s", buf);
|
||||||
rt_interface_->addCommandToQueue(buf);
|
rt_interface_->addCommandToQueue(buf);
|
||||||
}
|
}
|
||||||
void UrDriver::setFlag(unsigned int n, bool b) {
|
void UrDriver::setFlag(unsigned int n, bool b) {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, "sec setOut():\n\tset_flag(%d, %s)\nend\n", n,
|
sprintf(buf, "sec setOut():\n\tset_flag(%d, %s)\nend\n", n,
|
||||||
b ? "True" : "False");
|
b ? "True" : "False");
|
||||||
printf("%s", buf);
|
//printf("%s", buf);
|
||||||
rt_interface_->addCommandToQueue(buf);
|
rt_interface_->addCommandToQueue(buf);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -138,14 +138,14 @@ void UrDriver::setDigitalOut(unsigned int n, bool b) {
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, "sec setOut():\n\tset_digital_out(%d, %s)\nend\n", n,
|
sprintf(buf, "sec setOut():\n\tset_digital_out(%d, %s)\nend\n", n,
|
||||||
b ? "True" : "False");
|
b ? "True" : "False");
|
||||||
printf("%s", buf);
|
//printf("%s", buf);
|
||||||
rt_interface_->addCommandToQueue(buf);
|
rt_interface_->addCommandToQueue(buf);
|
||||||
|
|
||||||
}
|
}
|
||||||
void UrDriver::setAnalogOut(unsigned int n, double f) {
|
void UrDriver::setAnalogOut(unsigned int n, double f) {
|
||||||
char buf[256];
|
char buf[256];
|
||||||
sprintf(buf, "sec setOut():\n\tset_tool_voltage(%d, %1.4f)\nend\n", n, f);
|
sprintf(buf, "sec setOut():\n\tset_analog_out(%d, %1.4f)\nend\n", n, f);
|
||||||
printf("%s", buf);
|
//printf("%s", buf);
|
||||||
rt_interface_->addCommandToQueue(buf);
|
rt_interface_->addCommandToQueue(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ 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,
|
sprintf(cmd,
|
||||||
"speedj([%1.5f, %1.5f, %1.5f, %1.5f, %1.5f, %1.5f], %1.5f,0.02)\n",
|
"speedj([%1.5f, %1.5f, %1.5f, %1.5f, %1.5f, %1.5f], %f, 0.02)\n",
|
||||||
q0, q1, q2, q3, q4, q5, acc);
|
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.) {
|
||||||
|
|||||||
@@ -317,7 +317,6 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void speedInterface(const trajectory_msgs::JointTrajectory::Ptr& msg) {
|
void speedInterface(const trajectory_msgs::JointTrajectory::Ptr& msg) {
|
||||||
reorder_traj_joints(*msg);
|
|
||||||
double acc = *std::max_element(msg->points[0].accelerations.begin(),
|
double acc = *std::max_element(msg->points[0].accelerations.begin(),
|
||||||
msg->points[0].accelerations.end());
|
msg->points[0].accelerations.end());
|
||||||
robot_.setSpeed(msg->points[0].velocities[0],
|
robot_.setSpeed(msg->points[0].velocities[0],
|
||||||
|
|||||||
Reference in New Issue
Block a user