ros的时间系统

最近很忙,也没空花时间去整理博客,因此仅按着自己能理解的方式记录。

ros的时间系统对于一个初学者来说其实很难处理,因为不去管好像也可以用,但会出一些报错,去学的话又觉得费工夫,不确定用不用的上。下面是一些概念的解释。
关于ros::time::now()在use_sim_time参数影响下的值。
No. The value of ros::time::now() depends on whether the parameter use_sim_time is set.

If use_sim_time == false, ros::time::now() gives you system time (seconds since 1970-01-01 0:00, so something like 1471868323.123456).
If use_sim_time == true, and you play a rosbag, ros::time::now() gives you the time when the rosbag was recorded (probably also something like 1471868323.123456).
If use_sim_time == true, and you run a simulator like Gazebo, ros::time::now() gives you the time from when the simulation was started, starting with zero (so probably something like 63.123456 if the simulator has been running for 63.123456 seconds).
Cases 2 and 3 are in simulation time, so a trajectory that takes 20 seconds to complete will alway

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值