EEEManchester / gazebo_radiation_plugin

9 stars 5 forks source link

Sensor Value Calculation #3

Closed OAkyildiz closed 2 years ago

OAkyildiz commented 2 years ago

Hi,

On Line 251 in RadiationSensor.cpp I see that you are sorting 9 recent radiation calculations, picking the median, then generating a random integer. Given that this last part simulates the random events, what is the reason you are using the last 9 readings? As the default sample rate is 1Hz, wouldn't that involve potentially unrelated rad values to generate the # of counts? (Is it to simulate hysteresis)?

Best Regards,

PS: I separated the Simulated_Radiation_Messages.msg into another package (as SimulatedRadiation) as it was not a part of any library in the package and radiation_layer was having a hard time depending on it.

DrAndyWest commented 2 years ago

Hi,

Both the Kinetic and Melodic versions should be fixed, and I will close this ticket. Great spot, thank you for taking the time to check the code before using!

I don't believe it was actually using that value, but it was some remnant code from an experiment to mimic a ThermoFisher RadEye G10, which averages over the last 8 or so seconds. In future, I would recommend to set up a subscriber to the sensor topic, and perform any instrument specific behaviours there as a separate topic.

As a note, the message types will be reverting to https://github.com/EEEManchester/radiation_msgs in the near future.

Cheers, Andy