File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -197,11 +197,11 @@ hardware_interface::return_type RRBotSystemWithGPIOHardware::read(
197197 unsigned int seed = static_cast <unsigned int >(time (NULL )) + 1 ;
198198 set_state (
199199 info_.gpios [0 ].name + " /" + info_.gpios [0 ].state_interfaces [1 ].name ,
200- static_cast <float >(rand_r (&seed)));
200+ static_cast <double >(rand_r (&seed)));
201201 seed = static_cast <unsigned int >(time (NULL )) + 2 ;
202202 set_state (
203203 info_.gpios [0 ].name + " /" + info_.gpios [0 ].state_interfaces [2 ].name ,
204- static_cast <float >(rand_r (&seed)));
204+ static_cast <double >(rand_r (&seed)));
205205
206206 for (const auto & [name, descr] : gpio_state_interfaces_)
207207 {
Original file line number Diff line number Diff line change @@ -184,7 +184,8 @@ hardware_interface::return_type RRBotSystemWithSensorHardware::read(
184184 // Simulate RRBot's sensor data
185185 unsigned int seed = static_cast <unsigned int >(time (NULL )) + i++;
186186 set_state (
187- name, static_cast <float >(rand_r (&seed)) / (static_cast <float >(RAND_MAX / hw_sensor_change_)));
187+ name,
188+ static_cast <double >(rand_r (&seed)) / (static_cast <double >(RAND_MAX / hw_sensor_change_)));
188189
189190 ss << std::endl << " \t " << get_state (name) << " for sensor '" << name << " '" ;
190191 }
You can’t perform that action at this time.
0 commit comments