Skip to content
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

Add Docker for testing ROS wrapper #3635

Merged
merged 3 commits into from
Sep 16, 2021
Merged

Conversation

rajat2004
Copy link
Contributor

@rajat2004 rajat2004 commented Apr 28, 2021

Fixes: #

About

This PR adds an example Dockerfile for testing the ROS wrapper. My current ROS install on host is broken (long story), that's why wrote this script.

  1. Build the image - docker build -t airsim-ros -f Dockerfile-ROS .
  2. Run: docker run --rm -it --net=host -v ~/AirSim:/home/testuser/AirSim airsim-ros:latest bash

Inside container:

  1. source /opt/ros/melodic/setup.bash, or add to .bashrc (echo "source /opt/ros/melodic/setup.bash" >> .bashrc)
  2. cd AirSim/ros, catkin build -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 (Basically https://microsoft.github.io/AirSim/airsim_ros_pkgs/#build)
  3. source devel/setup.bash
  4. roslaunch airsim_ros_pkgs airsim_node.launch output:=screen

Output:

testuser@rajat-G5-5587:~/AirSim/ros$ roslaunch airsim_ros_pkgs airsim_node.launch output:=screen 
... logging to /home/testuser/.ros/log/8d7e9dea-a7ef-11eb-b388-983b8feaaf24/roslaunch-rajat-G5-5587-286.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://127.0.0.1:38077/

SUMMARY
========

PARAMETERS
 * /airsim_node/host_ip: localhost
 * /airsim_node/is_vulkan: False
 * /airsim_node/publish_clock: False
 * /airsim_node/update_airsim_control_every_n_sec: 0.01
 * /airsim_node/update_airsim_img_response_every_n_sec: 0.05
 * /airsim_node/update_lidar_every_n_sec: 0.01
 * /rosdistro: melodic
 * /rosversion: 1.14.10

NODES
  /
    airsim_node (airsim_ros_pkgs/airsim_node)
    ned_to_enu_pub (tf/static_transform_publisher)

auto-starting new master
process[master]: started with pid [296]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 8d7e9dea-a7ef-11eb-b388-983b8feaaf24
process[rosout-1]: started with pid [307]
started core service [/rosout]
process[airsim_node-2]: started with pid [310]
Fetching settings.json from AirSim
Waiting for connection - 
Connected!

Client Ver:1 (Min Req:1), Server Ver:1 (Min Req:1)
SimMode: Car
[ INFO] [1619593292.883246387]: Setting ROS wrapper to CAR mode
Waiting for connection - 
Connected!

Client Ver:1 (Min Req:1), Server Ver:1 (Min Req:1)
Waiting for connection - 
Connected!

Client Ver:1 (Min Req:1), Server Ver:1 (Min Req:1)
Waiting for connection - 
Connected!

Client Ver:1 (Min Req:1), Server Ver:1 (Min Req:1)
[ INFO] [1619593292.891566542]: AirsimROSWrapper Initialized!
process[ned_to_enu_pub-3]: started with pid [315]

Also demonstrates that settings.json isn't required after #3536

TODO:

  • Add info of usage to the docs

How Has This Been Tested?

Used the docker container to test that no settings.json file is required if using the latest master AirSim. With a 1.4.0 release, the fallback behaviour is seen -

...
setting /run_id to 22b5eae0-b07d-11eb-a30f-983b8feaaf24
process[rosout-1]: started with pid [820]
started core service [/rosout]
process[airsim_node-2]: started with pid [823]
Fetching settings.json from AirSim
Waiting for connection - 
Connected!

Client Ver:1 (Min Req:1), Server Ver:1 (Min Req:1)
Exception raised by the API, something went wrong: rpclib: server could not find function 'getSettingsString' with argument count 0.
Falling back to reading from ~/Documents/AirSim/settings.json
...

Screenshots (if appropriate):

@rajat2004 rajat2004 marked this pull request as ready for review September 11, 2021 04:16
@zimmy87 zimmy87 merged commit 4d07f6e into microsoft:master Sep 16, 2021
@zimmy87
Copy link
Contributor

zimmy87 commented Sep 16, 2021

ran the dockerfile and built the ROS wrapper successfully inside and outside of docker, so this looks good to me; thanks for the contribution @rajat2004!

@rajat2004 rajat2004 deleted the ros-docker branch September 17, 2021 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants