dji-sdk / Guidance-SDK-ROS

The official ROS package of Guidance SDK for 32/64 bit Ubuntu and XU3
80 stars 87 forks source link

Safely kill the node #19

Closed tngan closed 8 years ago

tngan commented 8 years ago

How can I exit and rerun the node safely ? When I terminate the guidanceNode (ctrl-c) after running rosrun guidance guidanceNode successfully for a while, the error message shows up when I rerun the guidanceNode.

llibusb_get_device_list ret = 9 !!!
Waiting for board ready ...
Error: e_timeout at 247, /.........../guidanceNode.cpp

and the line 247 is the code for guidance initialization.

tngan commented 8 years ago

The program exits before stop_transfer and release_transfer. It could be exited by pressing the q button.

curantil commented 8 years ago

I think this is because sleep(1) on line 363 is used. On Windows sleep is in seconds, but on Linux it is in microseconds. It thus has no time to wait for the ack package.