-
Notifications
You must be signed in to change notification settings - Fork 281
Closed
Description
Affected ROS2 Driver version(s)
2.2.14
Used ROS distribution.
Humble
Which combination of platform is the ROS driver running on.
Ubuntu Linux with standard kernel
How is the UR ROS2 Driver installed.
Build both the ROS driver and UR Client Library from source
Which robot platform is the driver connected to.
UR E-series robot
Robot SW / URSim version(s)
5.17.0
How is the ROS driver used.
Headless without using the teach pendant
Problem Description
Reconfiguring the UR hardware component (which can be done using the ~/set_hardware_component_state
service call to unconfigure and then activate the UR hardware component) results in a code failure due to following issues
- The
registerUrclLogHandler()
function which is called in theon_configure()
function usesstd::move
to transfer ownership ofg_log_handler
. As a result, calling theon_configure()
function again causes a failure. This is because theg_log_handler
pointer has already been moved, and it no longer has access to thesetTFPrefix()
function. - The
checkAsyncIO()
function cannot be called in theasyncThread()
function after reconfiguring the hardware component. This is because theasync_thread_shutdown_
variable is set to true in theon_cleanup()
function and is not reset to false in theon_configure()
function.
Workaround Suggestion
To avoid such crashes, following changes are suggested
- It is suggested to declare and assign the pointer within the
registerUrclLogHandler()
function instead of doing so globally. Therefore, it is suggested to modify the function as follows:
void registerUrclLogHandler(const std::string& tf_prefix)
{
if (g_registered == false) {
std::unique_ptr<UrclLogHandler> g_log_handler(new UrclLogHandler);
g_log_handler->setTFPrefix(tf_prefix);
// Log level is decided by ROS2 log level
urcl::setLogLevel(urcl::LogLevel::DEBUG);
urcl::registerLogHandler(std::move(g_log_handler));
g_registered = true;
}
}
- It is suggested to set
async_thread_shutdown_
tofalse
inon_configure()
function
Accept Public visibility
- I agree to make this context public
Metadata
Metadata
Assignees
Labels
No labels