mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 10:00:48 +02:00
code cleanup
This commit is contained in:
@@ -70,7 +70,7 @@ public:
|
||||
bool doTraj(std::vector<double> inp_timestamps,
|
||||
std::vector<std::vector<double> > inp_positions,
|
||||
std::vector<std::vector<double> > inp_velocities);
|
||||
void servoj(std::vector<double> positions, int keepalive = 1, double time = 0);
|
||||
void servoj(std::vector<double> positions, int keepalive = 1);
|
||||
|
||||
void stopTraj();
|
||||
|
||||
|
||||
@@ -168,18 +168,16 @@ bool UrDriver::doTraj(std::vector<double> inp_timestamps,
|
||||
return true;
|
||||
}
|
||||
|
||||
void UrDriver::servoj(std::vector<double> positions, int keepalive,
|
||||
double time) {
|
||||
void UrDriver::servoj(std::vector<double> positions, int keepalive) {
|
||||
if (!reverse_connected_) {
|
||||
print_error("UrDriver::servoj called without a reverse connection present. Keepalive: " + std::to_string(keepalive));
|
||||
print_error(
|
||||
"UrDriver::servoj called without a reverse connection present. Keepalive: "
|
||||
+ std::to_string(keepalive));
|
||||
return;
|
||||
}
|
||||
unsigned int bytes_written;
|
||||
int tmp;
|
||||
unsigned char buf[28];
|
||||
if (time < 0.016) {
|
||||
time = servoj_time_;
|
||||
}
|
||||
for (int i = 0; i < 6; i++) {
|
||||
tmp = htonl((int) (positions[i] * MULT_JOINTSTATE_));
|
||||
buf[i * 4] = tmp & 0xff;
|
||||
@@ -303,10 +301,10 @@ bool UrDriver::start() {
|
||||
sec_interface_->robot_state_->getVersion());
|
||||
if (!rt_interface_->start())
|
||||
return false;
|
||||
ip_addr_ = rt_interface_->getLocalIp(); //inet_ntoa(serv_addr.sin_addr);
|
||||
char buf[256];
|
||||
sprintf(buf, "Listening on %s:%u\n", ip_addr_.c_str(), REVERSE_PORT_);
|
||||
print_debug(buf);
|
||||
ip_addr_ = rt_interface_->getLocalIp();
|
||||
print_debug(
|
||||
"Listening on " + ip_addr_ + ":" + std::to_string(REVERSE_PORT_)
|
||||
+ "\n");
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user