mirror of
https://gitlab.com/obbart/universal_robots_ros_driver.git
synced 2026-04-10 18:10:47 +02:00
Re-add urscript topic (#7)
* Re-added UR script - for custom UR Script execution * Restarting the driver when robot closes the connection on script error. The pipelines work in the way that if the connection is is closed by the control PC, it will not be re-established. This happens for example if you use the URScript topic and upload script that does not compile. The robot will then close the connection, the pipeline will close and any subsequent uploads will fail and noone realises there is a problem. While we could re-establish the connection, I think much better solution is to shutdown the driver in such case. This is much more resilient behaviour as it will clean up any inconsistent driver state. We can utilise "respawn" feature of ROS launch and restart such driver automatically (launch files are updated as part of that change). On top of "production" stability, it allows for much nicer development workflow - you can use URScript topic for development of new scripts and have the driver restart every time you make mistake. Without it, any mistake requires restarting the driver manually.
This commit is contained in:
committed by
Simon Rasmussen
parent
24eef75d72
commit
6950b3c4bd
@@ -1,7 +1,7 @@
|
||||
#include "ur_modern_driver/ur/commander.h"
|
||||
#include "ur_modern_driver/log.h"
|
||||
|
||||
bool URCommander::write(std::string &s)
|
||||
bool URCommander::write(const std::string &s)
|
||||
{
|
||||
size_t len = s.size();
|
||||
const uint8_t *data = reinterpret_cast<const uint8_t *>(s.c_str());
|
||||
@@ -20,8 +20,9 @@ void URCommander::formatArray(std::ostringstream &out, std::array<double, 6> &va
|
||||
out << "]";
|
||||
}
|
||||
|
||||
bool URCommander::uploadProg(std::string &s)
|
||||
bool URCommander::uploadProg(const std::string &s)
|
||||
{
|
||||
LOG_DEBUG("Sending program [%s]",s.c_str());
|
||||
return write(s);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user