Closed guihomework closed 6 years ago
Thanks for the PR. Could you also add the prefix [ftsensor up:port] for all messages ?
@ahoarau back from holiday, finishing working on it asap
Fixed header and tested locally. when working
[ INFO] [1510769573.025842534]: ATISensor IP : 192.168.10.100
[ INFO] [1510769573.025920675]: ATISensor frame : /ati_frame
[ft_sensor 192.168.10.101:49152] Start realtime streaming with 1 samples
[ft_sensor 192.168.10.101:49152] Using current calibration
[ft_sensor 192.168.10.101:49152] Sucessfully retrieved counts per force : 1000000
[ft_sensor 192.168.10.101:49152] Sucessfully retrieved counts per torque : 1000000
[ INFO] [1510769573.058763111]: ATISensor RDT Rate : 7000
when fails
[ INFO] [1510772385.124127616]: ATISensor IP : 192.168.10.100
[ INFO] [1510772385.124198430]: ATISensor frame : /ati_link
[ft_sensor 192.168.10.100:49152] Could not connect to 192.168.10.100
[ft_sensor 192.168.10.100:49152] openSockets error: failed to connect to socket
[ft_sensor 192.168.10.100:49152] Error during initialization, FT sensor NOT started
[ft_sensor 192.168.10.100:49152] Sensor shutdown sucessfully
[FATAL] [1510772403.495391524]: Failed with error : FT sensor could not initialize
Good. Tiny remark : Sensor shutdown sucessfully
is not necessary (?)
I inverted the test to create a message if not shutting down properly
Shall we remove this message instead ? If sensor is not present, then the shutdown cannot be 'not successful' :)
I think it is important to know when open sockets could not close correctly. The closing should handle the fact that the socket might not have been open (so should succeed to close something not open).
However I have doubts on how it was handled before my change : https://github.com/kuka-isir/ati_sensor/blob/master/src/ft_sensor.cpp#L308 returns true if the return value is positive on both. However positive will never occur because close is never positive (https://linux.die.net/man/2/close) So return was always false, so always 0
I suggest the following.
100% agree :+1:
I fixed it and there is no message shown, even if badly disconnecting and such (probably because it never fails to close the handler)
Modified failure detection to stop at first major error and improved error messages
As discussed in #13
Not all failure case could be tested, don't know how to produce them. But the main fail described in #13 looks like this now