mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-11 02:20:48 +02:00
Clang-format run
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
#include "ur_modern_driver/ur/commander.h"
|
||||
#include "ur_modern_driver/log.h"
|
||||
|
||||
bool URCommander::write(std::string& s)
|
||||
bool URCommander::write(std::string &s)
|
||||
{
|
||||
size_t len = s.size();
|
||||
const uint8_t* data = reinterpret_cast<const uint8_t*>(s.c_str());
|
||||
const uint8_t *data = reinterpret_cast<const uint8_t *>(s.c_str());
|
||||
size_t written;
|
||||
return stream_.write(data, len, written);
|
||||
}
|
||||
@@ -12,10 +12,10 @@ bool URCommander::write(std::string& s)
|
||||
void URCommander::formatArray(std::ostringstream &out, std::array<double, 6> &values)
|
||||
{
|
||||
std::string mod("[");
|
||||
for(auto const& val : values)
|
||||
for (auto const &val : values)
|
||||
{
|
||||
out << mod << val;
|
||||
mod = ",";
|
||||
out << mod << val;
|
||||
mod = ",";
|
||||
}
|
||||
out << "]";
|
||||
}
|
||||
@@ -27,7 +27,7 @@ bool URCommander::uploadProg(std::string &s)
|
||||
|
||||
bool URCommander::setToolVoltage(uint8_t voltage)
|
||||
{
|
||||
if(voltage != 0 || voltage != 12 || voltage != 24)
|
||||
if (voltage != 0 || voltage != 12 || voltage != 24)
|
||||
return false;
|
||||
|
||||
std::ostringstream out;
|
||||
@@ -59,7 +59,6 @@ bool URCommander::stopj(double a)
|
||||
return write(s);
|
||||
}
|
||||
|
||||
|
||||
bool URCommander_V1_X::speedj(std::array<double, 6> &speeds, double acceleration)
|
||||
{
|
||||
std::ostringstream out;
|
||||
@@ -86,7 +85,6 @@ bool URCommander_V1_X::setDigitalOut(uint8_t pin, bool value)
|
||||
return write(s);
|
||||
}
|
||||
|
||||
|
||||
bool URCommander_V3_X::speedj(std::array<double, 6> &speeds, double acceleration)
|
||||
{
|
||||
std::ostringstream out;
|
||||
@@ -110,16 +108,16 @@ bool URCommander_V3_X::setDigitalOut(uint8_t pin, bool value)
|
||||
std::ostringstream out;
|
||||
std::string func;
|
||||
|
||||
if(pin < 8)
|
||||
if (pin < 8)
|
||||
{
|
||||
func = "set_standard_digital_out";
|
||||
}
|
||||
else if(pin < 16)
|
||||
else if (pin < 16)
|
||||
{
|
||||
func = "set_configurable_digital_out";
|
||||
pin -= 8;
|
||||
}
|
||||
else if(pin < 18)
|
||||
else if (pin < 18)
|
||||
{
|
||||
func = "set_tool_digital_out";
|
||||
pin -= 16;
|
||||
@@ -127,7 +125,6 @@ bool URCommander_V3_X::setDigitalOut(uint8_t pin, bool value)
|
||||
else
|
||||
return false;
|
||||
|
||||
|
||||
out << func << "(" << (int)pin << "," << (value ? "True" : "False") << ")\n";
|
||||
std::string s(out.str());
|
||||
return write(s);
|
||||
|
||||
Reference in New Issue
Block a user