Monash-Connected-Autonomous-Vehicle / autoware.universe

An attempt to integrate driveworks interface into autoware.universe
https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
0 stars 0 forks source link

Docker Container for Autoware distribution #5

Open dylan-gonzalez opened 1 year ago

dylan-gonzalez commented 1 year ago

It is insufficient to just have AutoWare run on a very particular setup, there should be a way to generalise the AutoWare installation on other devices easily.

Experiment and use the provided docker installation. Identify pros and cons of this method as compared to source to determine suitability for distribution.

zcdai commented 1 year ago

[Imported logs from few days ago] Tried docker things, launching with GPU support didn't work until https://github.com/NVIDIA/nvidia-docker/issues/1243 fixed it

General things about docker: Still getting ros sourcing issues when trying to run. Building seems to go well, sometimes ansible doesn't work on certain containers but this is inconsistent? Everything performed on a non-fresh Ubuntu install, looks difficult to adapt docker image to everyone's personal devices.

Following the tutorial, the docker repo with NVIDIA support does not seem to work, use the barebones ROS one instead.

maarkks commented 1 year ago

Followed the development installation here https://autowarefoundation.github.io/autoware-documentation/main/installation/autoware/docker-installation/

Started the installation process using ansible. Discovered errors regarding CUDA dependencies. NVIDIA properties were also mentioned, but proceeded. Workspace setup should be straightforward (?) after this step.

Tried to launch the current installation of docker separately (using the general user), encountered an error stating that KVM is not enabled on host. This relates to the enabling of virtualisation support - needs to be turned on in the system bios. Retried this on the fresh AWSIM user profile, with the same problem. Redownloaded the docker packages and application, but still have this same problem.

npnquang commented 1 year ago

Image

Docker Engine still works somehow even the beast does not support virtualization. Keep in mind that we need Docker Engine for the setup. Right now we are on the downloading step so it still might fail when we run the Docker Image.

npnquang commented 1 year ago

Image

These docker images are essential for running docker container of autoware. Right now the container is launchable, but we need to see if the container works correctly as expected. Link to the installation

[!Important] DO NOT delete those Docker image, especially the one from the autowarefoundation repository

npnquang commented 1 year ago
npnquang commented 1 year ago

Image

We have Autoware working now, but the UI looks nothing like this tutorial

Image

[!Important]

  • Remember to source the setup file and then run this command to launch it. ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=sample_vehicle sensor_model:=awsim_sensor_kit map_path:=<your mapfile location>
  • Right now the docker container is mounted with the local autoware directory, so we do not have to build every time we launch the container.
  • The same thing happens for the autoware_map directory.
dylan-gonzalez commented 1 year ago

Following on from @npnquang Looking at the tutorial he linked to run Autoware with AWSIM.

Run the executable for AWSIM at ~/AWSIM/AWSIM_demo.x86_64. Made sure to switch to the awsim-stable branch as they state.

Run Docker container rocker --nvidia --x11 --user --volume $HOME/autoware --volume $HOME/autoware_map --volume $HOME/autoware_data-- ghcr.io/autowarefoundation/autoware-universe:latest-cuda

Run Autoware (make sure to specify absolute path for mapfile location): source install/setup.bash ros2 launch autoware_launch e2e_simulator.launch.xml vehicle_model:=sample_vehicle sensor_model:=awsim_sensor_kit map_path:=/home/mcav/autoware_map/pointcloud_map.pcd

Can't seem to load the map properly. Trying a mapfile of /home/mcav/autoware_map/ (might require the map directory which has a .pcd and .osm file, https://autowarefoundation.github.io/autoware-documentation/main/support/troubleshooting/) --> This worked!!

Following these steps now to test a simulation scenario.

Simulation scenarios work great (bit slow, maybe had a few issues with traffic light recognition it seemed?)

dylan-gonzalez commented 1 year ago

03/11/23 with @npnquang

We tried to run Autoware with AWSIM again and it we were getting errors with some of the modules. Autoware RVIZ screen UI would show with the map, but camera feed was displaying 'No Image', with AUTO operation mode greyed out.

We will need to take a look at this discussion, which seems to be very similar to our problem, and try the recommended fixes.

npnquang commented 12 months ago

When trying to fix the persistent issues of Autoware, I tried listen to the /api/operation_mode/state topic but this error is returned: The message type 'autoware_adapi_v1_msgs/msg/OperationModeState' is invalid

I tried to reinstall autoware again but this error is raised: Image

dylan-gonzalez commented 12 months ago

For the 'invalid msg type' error, you need to have had sourced the workspace in that terminal before listening to the topics. Otherwise ROS won't have any knowledge of the custom msg type you're trying to listen to

npnquang commented 12 months ago

The issue is raised when the autoware is running so I don't think it was because I didn't source

dylan-gonzalez commented 12 months ago

But if you open a new terminal to do a ros2 topic echo then you will have to source it again in that new terminal window if the topics have custom msg typea

npnquang commented 12 months ago

After doing the installation once again for the relatively nonsense reason above, I realized that for the docker installation, we do not need anything even cuda. Let the ./setup-dev-env.sh docker do the thing for us. This is the best way to avoid any version conflicts.

Moreover, I also realized that we do not need cudnn and tensorRT when following the docker installation, while we do when following the source installation.

When checking the version of CUDA, we only need to check nvcc --version. The command nvidia-smi is not the correct one to check.

npnquang commented 12 months ago

When running Autoware, I listened to /api/operation_mode/state topic and it seems that nothing is sent to this topic. The screen remains the same for quite a while. Image

When listening to /diagnostics topic, this message is sent over and over again Image

npnquang commented 12 months ago

It seems that the installation guide did not mention anything regarding the autoware_data folder but I realized that we should mount that folder to the Docker container as well since some of the errors raised when loading up Autoware relates to that folder.

Image

Image

Image

After mounting the autoware_data folder to the Docker container, the above errors are resolved. So the correct command to run the container is rocker --nvidia --x11 --user --volume $HOME/autoware --volume $HOME/autoware_map --volume $HOME/autoware_data -- ghcr.io/autowarefoundation/autoware-universe:latest-cuda

UPDATE: We can confirm that autoware_data is the folder that supports the operation of Autoware now and it is generated when the autoware is built.

npnquang commented 12 months ago

We have the steering and velocity received by Autoware now but the problems with the Recognition Result is still unsolved. In addition, the /api/operation_mode/state topic is still quiet when listening to it.

Image

dylan-gonzalez commented 12 months ago

how did you get steering and velocity to be received by Autoware?

npnquang commented 12 months ago

I just rebuilt the autoware and the velocity and steering angle is not "not received" anymore.

dylan-gonzalez commented 12 months ago

ok so seems like checking out to the awsim-stable branch fixed that I think it might also be a good idea to pull the docker image again as I remember reading somewhere that they made some changes (I could be wrong though)

npnquang commented 12 months ago

I have pulled it again multiple times and the image remains unchanged.

npnquang commented 12 months ago

I have put a post to ask about our issues now on the GitHub page of Autoware.

dylan-gonzalez commented 11 months ago

i've bumped your issue to the discord so that we get responses quicker https://discordapp.com/channels/953808765935816715/1172387460844625963

dylan-gonzalez commented 11 months ago

Debugging - here's what I've done

AWSIM

  1. Run AWSIM
  2. ros2 topic list to see what topics are running

Image

  1. I see a few of them use message definitions from Autoware. If I try to echo these topics I will get the following error: The message type is invalid. To fix this, you need to source the autoware workspace: cd ~/autoware && source install/setup.bash.
  2. the AWSIM topics are being published fine. So I can conclude the issue is not with AWSIM.

Autoware Universe

  1. Running the docker container and running autoware_launch gives the same results as above ^ as expected. Looking at the terminal output, shows this error that occurs routinely (i.e keeps trying to initialise but fails):

Image

  1. searching up default_ad_api. Brought me to this issue. Then realised that you can run a planning simulation without a running simulator, and just using RVIZ. So will try this.

Planning Simulation

Image

Trying Autoware + AWSIM again

I'm a bit confused as to how Autoware is running outside of the docker container. @npnquang did you do a source installation or docker installation development?

Changes I've made:

npnquang commented 11 months ago

We have a docker installation development.

dylan-gonzalez commented 11 months ago

We have concluded that Autoware Universe is working inside and outside the docker container.

The reason why it doesn't work properly with AWSIM when Autoware is run inside the docker container is due to networking issues.

sxppro commented 11 months ago

@dylan-gonzalez @npnquang can we give the Autoware maintainers an update in this issue: https://github.com/orgs/autowarefoundation/discussions/3970

sxppro commented 11 months ago

(unless it was resolved through some other channel oops)