-
Notifications
You must be signed in to change notification settings - Fork 4.7k
AirSim (+ ROS wrapper) not publishing clock when /use_sim_time is set to true? #4442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll add, that in ROS terms at least, the airsim_node is not acting as a clock server when "use_sim_time" is true, but when "use_sim_time" is false, it is acting as a clock server. It should work in both cases, given "publish_clock" is set to true in the launchfile. Hopefully, this clarifies the issue. |
Hello,
Do not forget to build the plugin after doing this modification.
This way, my rosbag is recorded using published clock. When I play the rosbag file without any specific option everything works well
You can also check your bag file using:
|
@yhabib29 What version of AirSim are you using? Are you using a car or a drone? What version of ROS? |
Hey @zdjeffri , sorry again, I have just checked the whole pipeline and I was wrong in my second comment (removed). |
Any updates to airsim_ros that addresses this issue? the above method works for recording bag files but does not enable testing navigation algorithms in simulation (i.e. SIL). Can force ROS to use real-time but then if Airsim clock speed is != 1.0, there are timing issues. |
I recently meet the same problem and solve it by changing the timer of drone_state_timer_cb from ros::Timer to ros::WallTimer. |
The issue seems to be that AirSim's ROS wrapper publishes // airsim_ros_wrapper.h
ros::Timer airsim_control_update_timer_;
// airsim_ros_wrapper.cpp
airsim_control_update_timer_ = nh_private_.createTimer(
ros::Duration(update_airsim_control_every_n_sec),
&AirsimROSWrapper::drone_state_timer_cb, this);
void AirsimROSWrapper::drone_state_timer_cb(const ros::WallTimerEvent& event)
{
// other stuff
// publish the simulation clock
if (publish_clock_) {
clock_pub_.publish(ros_clock_);
}
// other stuff
}
@dylanyd's |
Bug report
What's the issue you encountered?
Using AirSim to simulate lidar data for an autonomous robot. Have the clock speed for AirSim set at 0.5 (via settings.json). Can confirm this works properly because the clock topic is running at half-speed when the "use_sim_time" rosparam is false.
However, if "use_sim_time" is set to true, the clock is no longer published and the ROS Wrapper ceases to publish anything. In order to properly integrate the AirSim clock with other ROS nodes, "use_sim_time" needs to be set to true so that the ROS Time API returns what is being published by AirSim instead of the system clock.
Settings and other relevant files
AirSim Settings - settings.json
roslaunch file - airsim_node.launch
How can the issue be reproduced?
roslaunch airsim_ros_pkgs airsim_node.launch output:=screen host:=$WSL_HOST_IP
The text was updated successfully, but these errors were encountered: