Rosanswers logo

I followed this link to implement vrep_ros_bridge. I followed all the steps and successfully loaded the quadrotor scene from scenes in vrep_ros_bridge folder in my catkin workspace. However on running the simulation on vrep, it crashes with message

terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
./vrep.sh: line 33: 11486 Aborted                 (core dumped) "$dirname/$appname" "${PARAMETERS[@]}"

I'm using ros kinetic and vrep 3.5.

Please help me solve this error. thanks!

Originally posted by sjoshi13 on ROS Answers with karma: 1 on 2018-10-29

Post score: 0

Original comments

Comment by wiktor on 2019-03-16:
I'm facing the exact same problem. Did you find a solution?


1 Answer 1


Rosanswers logo

The the source of the exception is almost certainly right here (which dates from 2014): https://github.com/lagadic/vrep_ros_bridge/blob/a4e10d64a2dff85407a8c4e75fa2e669bcdb7c59/manipulator_handler/src/ManipulatorHandler.cpp#L394

_lastPrintedMsg = ros::Time(-1.0);

(and possibly there are other instances of bad time initialization in the same package, and there's also an issue where initializing a ros::Duration with an uninitialized double will sometimes result in a Duration is out of dual 32-bit range depending on if the uninitialized memory happens to be an acceptable Duration or not https://github.com/ros-controls/ros_controllers/pull/577):

Here's a simple example https://github.com/lucasw/timer_test/blob/master/src/bad_time.cpp

#include <iostream>
#include <ros/ros.h>

int main()
  const auto cur = ros::Time(-1);
 * this will be the result of the above
terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
  std::cout << cur << std::endl;
  const double sec = cur.toSec();
  std::cout << sec << std::endl;

For reference the exception is thrown from here (though for some cases there are some similarly phrased exceptions so it isn't always clear):


Maybe a few years and ros versions ago ros::Time(-1) was an unofficial sentinel value? Then it started throwing exceptions but the people encountering the exceptions and the rosccp_core maintainers were too many degrees separated to realize any of this. Or it was cleaned up in major packages that were being actively maintained, but little time bombs are lying around elsewhere.

Ideally something could be done to make it a compiler error (or we should all move to rust...).

Originally posted by lucasw with karma: 8729 on 2021-10-26

This answer was ACCEPTED on the original site

Post score: 2


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.