[Ros] Timestamp and floating point format conversion

mark

  • ros timestamp converted to floating point format
double time =ros::Time::now().toSec(); //把时间戳转化成浮点型格式
  • Convert floating point format to ros timestamp
odom.header.stamp = ros::Time().fromSec(time); //把浮点型变成时间戳

Guess you like

Origin blog.csdn.net/qq_35632833/article/details/111298541