ROS2 Sim time for callbacks
Hello everyone, I have a test node class with the constructor as follows:
NodeTest::NodeTest(const rclcpp::NodeOptions& options) : Node("node_test", options)
{
this->set_parameter(rclcpp::Parameter("use_sim_time", true));
timer_ = this->create_wall_timer(std::chrono::milliseconds(1), std::bind(&NodeTest::doWork, this));
}
I intend to use simulation time. Is there anyway to have callback(i.e doWork in this case) execute on expiring simulation time instead of system time? Basically, I am trying to run doWork()at a specific frequency that is based on sim_time, so that I can also run simulation in "slow motion".