i run the ubuntu 16.04 and ros with version of kinetic. Moreover the airsim is running on the windows10.
Now i want to make a communication between ros and airsim so that i make some trajectory planning, perception, model training and so on in ros. Does it have some methods to realize this?
Hey, I've been trying to do this just today, I think you can specify host_ip of Airsim on Windows by setting a parameter when you launch an airsim client node: See line 12 in source, let me know if this works for you?
I've been trying to use ardupilot, mavlink and hopefully mavros but I havn't quite got it working yet.
You can try changing localhost to the IP address of the Windows machine here - https://github.com/microsoft/AirSim/blob/master/ros/src/airsim_ros_pkgs/launch/airsim_node.launch#L2
The PR which added this option - https://github.com/microsoft/AirSim/pull/2368
The docs need to be updated with the info, if someone does try it out, then a PR for improvements to the docs will be great!
@mhl787156 For Using AP+AirSim+ROS, you could try using the scripts mentioned here - https://ardupilot.org/dev/docs/sitl-with-airsim.html#ros-with-multi-vehicle-simulation. It's described for multiple vehicles but should work with changing it to a single vehicle
There's also the related Discuss topic which might be helpful - https://discuss.ardupilot.org/t/airsim-multiple-arducopter-sitl-mavros/49613
Hey, I've been trying to do this just today, I think you can specify host_ip of Airsim on Windows by setting a parameter when you launch an airsim client node: See line 12 in source, let me know if this works for you?
I've been trying to use ardupilot, mavlink and hopefully mavros but I havn't quite got it working yet.
Hi, mhl787156,
firstly thanks for your advice, i have tried this api. I think it has already worked. After you installed the ros_wrapper for airsim, you can just change the host_ip as ip address of your local machine, like @rajat2004 said. By now i'm just tesing the connection between ros and airsim, so i can't say anything about usage of provided api.
You can try changing
localhostto the IP address of the Windows machine here - https://github.com/microsoft/AirSim/blob/master/ros/src/airsim_ros_pkgs/launch/airsim_node.launch#L2
The PR which added this option - #2368
The docs need to be updated with the info, if someone does try it out, then a PR for improvements to the docs will be great!@mhl787156 For Using AP+AirSim+ROS, you could try using the scripts mentioned here - https://ardupilot.org/dev/docs/sitl-with-airsim.html#ros-with-multi-vehicle-simulation. It's described for multiple vehicles but should work with changing it to a single vehicle
There's also the related Discuss topic which might be helpful - https://discuss.ardupilot.org/t/airsim-multiple-arducopter-sitl-mavros/49613
hi rajat2004,
you're right. i have tried this method. the connection works.
FYI, I am currently using AirSim + ROS only on windows 10 by using WSL (ubuntu 18.04 + ROS melodic). Though I had some problems with GUI (such as rviz and rqt_image_view), now it's working fine.
FYI, I am currently using AirSim + ROS only on windows 10 by using WSL (ubuntu 18.04 + ROS melodic). Though I had some problems with GUI (such as rviz and rqt_image_view), now it's working fine.
hi, kminoda, maybe you can try the python api of airsim, if you don't have to use ros. by the way did you have tried the domain randonmization of airsim?
@lucafei No. Since I am new to AirSim&UE4, didn't even know that you can do this kind of thing easily in AirSim.
Hii @lucafei,
It might sound silly, but I am a newbie to ROS and I want to connect AirSim (windows) with ROS ubantu for extracting camera images from AirSIm simulator. If you could just let me know how you did that in a layman way I would be so thankful to you.
Hii @lucafei,
It might sound silly, but I am a newbie to ROS and I want to connect AirSim (windows) with ROS ubantu for extracting camera images from AirSIm simulator. If you could just let me know how you did that in a layman way I would be so thankful to you.
you can find the api for getting image in https://microsoft.github.io/AirSim/image_apis/
@lucafei
Can you let me know how I can get frames using that api and process it through a loop to get a video displayed in an opencv window?
If anyone comes across this trying to get ROS working in WSL, you'll need to set the host machine IP here:
https://github.com/microsoft/AirSim/blob/master/ros/src/airsim_ros_pkgs/launch/airsim_node.launch#L2
This is the actual IP address of you Windows machine - similar to how you set up X forwarding, you can't use localhost.
This worked for me - before I did it, I could see topic names, but no data came out of Unreal.
Most helpful comment
You can try changing
localhostto the IP address of the Windows machine here - https://github.com/microsoft/AirSim/blob/master/ros/src/airsim_ros_pkgs/launch/airsim_node.launch#L2The PR which added this option - https://github.com/microsoft/AirSim/pull/2368
The docs need to be updated with the info, if someone does try it out, then a PR for improvements to the docs will be great!
@mhl787156 For Using AP+AirSim+ROS, you could try using the scripts mentioned here - https://ardupilot.org/dev/docs/sitl-with-airsim.html#ros-with-multi-vehicle-simulation. It's described for multiple vehicles but should work with changing it to a single vehicle
There's also the related Discuss topic which might be helpful - https://discuss.ardupilot.org/t/airsim-multiple-arducopter-sitl-mavros/49613