mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 01:50:46 +02:00
extended SetIO service to correctly set configurable and tool digital output
This commit is contained in:
@@ -2,6 +2,10 @@ speed_slider_mask
|
|||||||
speed_slider_fraction
|
speed_slider_fraction
|
||||||
standard_digital_output_mask
|
standard_digital_output_mask
|
||||||
standard_digital_output
|
standard_digital_output
|
||||||
|
configurable_digital_output_mask
|
||||||
|
configurable_digital_output
|
||||||
|
tool_digital_output_mask
|
||||||
|
tool_digital_output
|
||||||
standard_analog_output_mask
|
standard_analog_output_mask
|
||||||
standard_analog_output_type
|
standard_analog_output_type
|
||||||
standard_analog_output_0
|
standard_analog_output_0
|
||||||
|
|||||||
@@ -546,8 +546,16 @@ void HardwareInterface::speedScalingCallback(const std_msgs::Float64::ConstPtr&
|
|||||||
bool HardwareInterface::setIO(ur_msgs::SetIORequest& req, ur_msgs::SetIOResponse& res)
|
bool HardwareInterface::setIO(ur_msgs::SetIORequest& req, ur_msgs::SetIOResponse& res)
|
||||||
{
|
{
|
||||||
if (req.fun == req.FUN_SET_DIGITAL_OUT)
|
if (req.fun == req.FUN_SET_DIGITAL_OUT)
|
||||||
|
{
|
||||||
|
if (req.pin <= 7)
|
||||||
{
|
{
|
||||||
res.success = ur_driver_->getRTDEWriter().sendStandardDigitalOutput(req.pin, req.state);
|
res.success = ur_driver_->getRTDEWriter().sendStandardDigitalOutput(req.pin, req.state);
|
||||||
|
} else if (req.pin <= 15)
|
||||||
|
{
|
||||||
|
res.success = ur_driver_->getRTDEWriter().sendConfigurableDigitalOutput(req.pin-8, req.state);
|
||||||
|
} else {
|
||||||
|
res.success = ur_driver_->getRTDEWriter().sendToolDigitalOutput(req.pin-16, req.state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (req.fun == req.FUN_SET_ANALOG_OUT)
|
else if (req.fun == req.FUN_SET_ANALOG_OUT)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -151,8 +151,8 @@ bool RTDEWriter::sendToolDigitalOutput(uint8_t output_pin, bool value)
|
|||||||
{
|
{
|
||||||
digital_output = 0;
|
digital_output = 0;
|
||||||
}
|
}
|
||||||
success = package->setData("tooldigital_output_mask", mask);
|
success = package->setData("tool_digital_output_mask", mask);
|
||||||
success = success && package->setData("tooldigital_output", digital_output);
|
success = success && package->setData("tool_digital_output", digital_output);
|
||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user