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

Added minPayload, maxPayload and maxVelocity

This commit is contained in:
Thomas Timm Andersen
2015-09-10 13:43:58 +02:00
parent 1c2b3ad259
commit 017810c30f
3 changed files with 23 additions and 5 deletions

View File

@@ -21,6 +21,9 @@
class UrDriver { class UrDriver {
private: private:
double maximum_time_step_; double maximum_time_step_;
double maximum_velocity_;
double minimum_payload_;
double maximum_payload_;
std::vector<std::string> joint_names_; std::vector<std::string> joint_names_;
public: public:
UrRealtimeCommunication* rt_interface_; UrRealtimeCommunication* rt_interface_;
@@ -47,7 +50,11 @@ public:
void setFlag(unsigned int n, bool b); void setFlag(unsigned int n, bool b);
void setDigitalOut(unsigned int n, bool b); void setDigitalOut(unsigned int n, bool b);
void setAnalogOut(unsigned int n, double f); void setAnalogOut(unsigned int n, double f);
void setPayloaf(double m); void setPayload(double m);
void setMaxVel(double vel);
void setMinPayload(double m);
void setMaxPayload(double m);
}; };

View File

@@ -12,10 +12,11 @@
#include "ur_modern_driver/ur_driver.h" #include "ur_modern_driver/ur_driver.h"
UrDriver::UrDriver(std::condition_variable& msg_cond, std::string host, UrDriver::UrDriver(std::condition_variable& msg_cond, std::string host,
unsigned int safety_count_max) { unsigned int safety_count_max) :
maximum_time_step_(0.08), maximum_velocity_(10.0), minimum_payload_(
0.0), maximum_payload_(1.0) {
rt_interface_ = new UrRealtimeCommunication(msg_cond, host, rt_interface_ = new UrRealtimeCommunication(msg_cond, host,
safety_count_max); safety_count_max);
maximum_time_step_ = 0.08;
} }
@@ -142,10 +143,20 @@ void UrDriver::setAnalogOut(unsigned int n, double f) {
rt_interface_->addCommandToQueue(buf); rt_interface_->addCommandToQueue(buf);
} }
void UrDriver::setPayloaf(double m){ void UrDriver::setPayload(double m) {
char buf[256]; char buf[256];
sprintf(buf, "sec setOut():\n\tset_payload(%1.3f)\nend\n", m); sprintf(buf, "sec setOut():\n\tset_payload(%1.3f)\nend\n", m);
printf("%s", buf); printf("%s", buf);
rt_interface_->addCommandToQueue(buf); rt_interface_->addCommandToQueue(buf);
} }
void UrDriver::setMaxVel(double vel) {
maximum_velocity_ = vel;
}
void UrDriver::setMinPayload(double m) {
minimum_payload_ = m;
}
void UrDriver::setMaxPayload(double m) {
maximum_payload_ = m;
}

View File

@@ -163,7 +163,7 @@ private:
bool setPayload(ur_msgs::SetPayloadRequest& req, bool setPayload(ur_msgs::SetPayloadRequest& req,
ur_msgs::SetPayloadResponse& resp) { ur_msgs::SetPayloadResponse& resp) {
robot_.setPayloaf(req.payload); robot_.setPayload(req.payload);
resp.success = true; resp.success = true;
return true; return true;
} }