CopterExpress / clever-show

Software for making the drone show with 🍀
GNU General Public License v3.0
76 stars 42 forks source link

Check if ROS services and nodes are available when perform any flying commands #21

Closed goldarte closed 4 years ago

goldarte commented 5 years ago

When ROS services are not available (when restart clever.service for example), the client emits this exception:

Starting takeoff! Traceback (most recent call last): File "client.py", line 297, in play_animation.takeoff(safe_takeoff=SAFE_TAKEOFF) File "/home/pi/CleverSwarm/Drone/play_animation.py", line 18, in takeoff FlightLib.takeoff(z=z, wait=True, emergency_land=False) File "/home/pi/CleverSwarm/Drone/FlightLib/FlightLib.py", line 243, in takeoff set_rates(thrust=0.1, auto_arm=True) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 435, in call return self.call(*args, **kwds) File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 505, in call raise ServiceException("unable to connect to service: %s"%e) rospy.service.ServiceException: unable to connect to service: [Errno 111] Connection refused Segmentation fault

artem30801 commented 5 years ago

TODO in flight task manager

artem30801 commented 5 years ago

Should work, probably needs testing

goldarte commented 5 years ago

Needs to be fully tested

goldarte commented 5 years ago

Fixed here https://github.com/CopterExpress/clever-show/commit/b17607e4c31402d75bd9e29ece767da0427d2858, but I still get exceptions from animation lib, when perform flying functions.

goldarte commented 4 years ago

Add lock to get_telemetry function, now there are no service exceptions. But for now, we don't check the copter state from the client's side, only lock some actions in the server GUI. We need to think about checking the copter state on each client independently before flying.

goldarte commented 4 years ago

I think we need to add task "preflight check" to client's task manager before each flight.

goldarte commented 4 years ago

Also, we need to check the nodes, which are used at current time for positioning:

goldarte commented 4 years ago

So we need the way to get the type(s) of positioning and check corresponding nodes. These nodes can crash, but /get_telemetry will output working-like result, so we need to know if our positioning nodes were crashed.

goldarte commented 4 years ago

This functionality is added to failsafe module