mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 10:00:48 +02:00
Run io serivce operations as secondary urscripts
This commit is contained in:
@@ -73,7 +73,7 @@ bool URCommander_V1_X::speedj(std::array<double, 6> &speeds, double acceleration
|
|||||||
bool URCommander_V1_X::setAnalogOut(uint8_t pin, double value)
|
bool URCommander_V1_X::setAnalogOut(uint8_t pin, double value)
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << "set_analog_out(" << (int)pin << "," << std::fixed << std::setprecision(4) << value << ")\n";
|
out << "sec io_fun():\n" << "set_analog_out(" << (int)pin << "," << std::fixed << std::setprecision(4) << value << ")\n" << "end\n";
|
||||||
std::string s(out.str());
|
std::string s(out.str());
|
||||||
return write(s);
|
return write(s);
|
||||||
}
|
}
|
||||||
@@ -81,7 +81,7 @@ bool URCommander_V1_X::setAnalogOut(uint8_t pin, double value)
|
|||||||
bool URCommander_V1_X::setDigitalOut(uint8_t pin, bool value)
|
bool URCommander_V1_X::setDigitalOut(uint8_t pin, bool value)
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << "set_digital_out(" << (int)pin << "," << (value ? "True" : "False") << ")\n";
|
out << "sec io_fun():\n" << "set_digital_out(" << (int)pin << "," << (value ? "True" : "False") << ")\n" << "end\n";
|
||||||
std::string s(out.str());
|
std::string s(out.str());
|
||||||
return write(s);
|
return write(s);
|
||||||
}
|
}
|
||||||
@@ -89,7 +89,7 @@ bool URCommander_V1_X::setDigitalOut(uint8_t pin, bool value)
|
|||||||
bool URCommander_V3_X::setAnalogOut(uint8_t pin, double value)
|
bool URCommander_V3_X::setAnalogOut(uint8_t pin, double value)
|
||||||
{
|
{
|
||||||
std::ostringstream out;
|
std::ostringstream out;
|
||||||
out << "set_standard_analog_out(" << (int)pin << "," << std::fixed << std::setprecision(5) << value << ")\n";
|
out << "sec io_fun():\n" << "set_standard_analog_out(" << (int)pin << "," << std::fixed << std::setprecision(5) << value << ")\n" << "end\n";
|
||||||
std::string s(out.str());
|
std::string s(out.str());
|
||||||
return write(s);
|
return write(s);
|
||||||
}
|
}
|
||||||
@@ -116,7 +116,7 @@ bool URCommander_V3_X::setDigitalOut(uint8_t pin, bool value)
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
out << func << "(" << (int)pin << "," << (value ? "True" : "False") << ")\n";
|
out << "sec io_fun():\n" << func << "(" << (int)pin << "," << (value ? "True" : "False") << ")\n" << "end\n";
|
||||||
std::string s(out.str());
|
std::string s(out.str());
|
||||||
return write(s);
|
return write(s);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user