Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

embObjMultipleFTsensors: Set the status to MAS_OK even if the timeout check is disabled #892

Merged
merged 1 commit into from
Jun 23, 2023

Conversation

traversaro
Copy link
Member

#871 introduce one critical bug in the embObjMultipleFTsensors YARP device: as for some reason the default value of checkUpdateTimeoutFlag_ is false, no check if the sensor is in timeout is done. As the assigned of the status to MAS_OK only happens if the check for timeout is done, what happened since #871 is that the sensor always returned the initial status MAS_WAITING_FOR_FIRST_READ, even if a first read already arrived.

This resulted in yarprobotinterface logs flooded by messages like:

	4631,378732	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_arm_ft_sensor, no data will be sent on the port.
	4631,378766	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_arm_ft_sensor, no data will be sent on the port.
	4631,388679	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_foot_rear_ft_sensor, no data will be sent on the port.
	4631,388760	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_foot_rear_ft_sensor, no data will be sent on the port.
	4631,388792	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_arm_ft_sensor, no data will be sent on the port.
	4631,388818	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_arm_ft_sensor, no data will be sent on the port.
	4631,398750	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_foot_rear_ft_sensor, no data will be sent on the port.
	4631,398846	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_foot_rear_ft_sensor, no data will be sent on the port.
	4631,398882	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_arm_ft_sensor, no data will be sent on the port.
	4631,398911	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_arm_ft_sensor, no data will be sent on the port.
	4631,398938	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_foot_rear_ft_sensor, no data will be sent on the port.
	4631,409028	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_foot_rear_ft_sensor, no data will be sent on the port.
	4631,409121	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_arm_ft_sensor, no data will be sent on the port.
	4631,409155	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_arm_ft_sensor, no data will be sent on the port.
	4631,409178	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_foot_rear_ft_sensor, no data will be sent on the port.
	4631,409201	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_foot_rear_ft_sensor, no data will be sent on the port.
	4631,419213	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_arm_ft_sensor, no data will be sent on the port.
	4631,419313	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_arm_ft_sensor, no data will be sent on the port.
	4631,419350	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_foot_rear_ft_sensor, no data will be sent on the port.
	4631,419379	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_foot_rear_ft_sensor, no data will be sent on the port.
	4631,429435	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_arm_ft_sensor, no data will be sent on the port.
	4631,429471	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_foot_rear_ft_sensor, no data will be sent on the port.
	4631,429488	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_foot_rear_ft_sensor, no data will be sent on the port.
	4631,429497	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_arm_ft_sensor, no data will be sent on the port.
	4631,429505	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor r_arm_ft_sensor, no data will be sent on the port.
	4631,439689	ERROR	yarp.device.multipleanalogsensorsserver		Failure in reading data from sensor l_foot_rear_ft_sensor, no data will be sent on the port.

and no FT measure was published on the YARP port.

This PR fixes the bug by setting the MAS_OK status whenever a new data is read, so that the status is correctly set even if no timeout is ever checked.

There could be more have been left out as it is more important to provide a bugfix as soon as possible:

  • Enable timeout check, by setting checkUpdateTimeoutFlag_ to true
  • Provide a different status for temperature readings and for FT readings, as given that the period of the two sensors is different, it is possible that while an FT sensor reading is available, for the temperature the first read has not been done.

@traversaro
Copy link
Member Author

@pattacini @Nicogene: unfortunatly this bug is quite critical, as it prevents users of iCub that use embObjMultipleFTsensors from reading the FT sensors on the robot.

@pattacini
Copy link
Member

Thanks!

@pattacini pattacini merged commit cceb839 into master Jun 23, 2023
@pattacini pattacini deleted the fixbugembobjft branch June 23, 2023 19:54
MSECode pushed a commit to MSECode/icub-main that referenced this pull request Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants