Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

According to this example here: I just set the use_sim_time parameter to true and also added the following code right after creating my node handle before the initialization of the ros publisher and ros subscriber and the update loop

// this wait is needed to ensure this ros node has gotten // simulation published /clock message, containing
// simulation time. ros::Time last_ros_time_; bool wait = true;
while (wait) { last_ros_time_ = ros::Time::now(); if (last_ros_time_.toSec() > 0) wait = false; }