Ask Your Question
1

Default unit of ros::Time::now()

asked 2018-07-03 03:34:33 -0600

kk2105 gravatar image

Hi All,

Could you please let me know the default unit of ros::Time::now()

Snippet of the code is given below

ros::Time ros_time; 
while (ros::ok())
{
    ros_time = ros::Time::now();
    //Some code
    rate.sleep();
    ros::spinOnce();
}

The output what I am getting is as below

   1530606380.304236318
   1530606380.323266596
   1530606380.343226943
   1530606380.364454049
   1530606380.383265757
   1530606380.403270513
   1530606380.423227417
   1530606380.443286735
   1530606380.463231277
   and so on..

Current system time is 14:00

Excuse me if the question is too simple.

Thank you. KK

edit retag flag offensive close merge delete

Comments

i have same question

Panason gravatar imagePanason ( 2019-08-03 04:48:31 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-07-03 03:55:26 -0600

gvdhoorn gravatar image

updated 2018-07-03 03:56:13 -0600

I believe #q189867 and wiki/roscpp/Overview/Time should explain this.

If it doesn't, please edit your question and clarify what is not clear yet.

edit flag offensive delete link more

Comments

@gvdhoorn Thank you ... Got it.. Whatever time returned by ros::Time::now() is in Unix epoch time format... which can be converted to time format using this website https://www.epochconverter.com/

kk2105 gravatar imagekk2105 ( 2018-07-03 07:04:57 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-07-03 03:34:33 -0600

Seen: 451 times

Last updated: Jul 03 '18