yangliu28 / swarm_robot_ros_sim

A swarm robot simulation environment for ROS to be used with Gazebo
MIT License
106 stars 33 forks source link

TIme is out of dual 32-bit range #10

Open MaverickHunterZeroX opened 4 years ago

MaverickHunterZeroX commented 4 years ago

I am using ROS Melodic on Ubuntu 18.04 LTS, and catkin build was successful after cloning https://github.com/yangliu28/swarm_robot_ros_sim. However, running the following command rosrun swarm_robot_simulation two_wheel_robot_dispersion _spring_length:=0.7 _sensing_range:=2.0 seems to throw the following error:

terminate called after throwing an instance of 'std::runtime_error'
  what():  Time is out of dual 32-bit range
Aborted (core dumped)
younger7 commented 4 years ago

the same error appears with ROS Kinetic on Ubuntu 16.04

teshanshanuka commented 3 years ago

I'm getting the same error. This is where the error happens

// initialize it with a negative time, so as to avoid mistaken for being active
ros::Time two_wheel_robot_topic_timer(-TOPIC_ACTIVE_PERIOD-0.1);
teshanshanuka commented 3 years ago

So I changed the negative value of the time to 0 and it seems to be working. However I did not investigate the impact of this on the rest of the code

// LINE 56: ros::Time two_wheel_robot_topic_timer(-TOPIC_ACTIVE_PERIOD-0.1);
ros::Time two_wheel_robot_topic_timer(0);
Shanky-Robot commented 2 years ago

Just remove the negative TOPIC_ACTIVE_PERIOD = 1.0 wo_wheel_robot_topic_timer is decrementing by 0.1

ros::Time two_wheel_robot_topic_timer(TOPIC_ACTIVE_PERIOD-0.1);