Open dylan-gonzalez opened 8 months ago
docker pull carlasim/carla:latest
sudo docker run --privileged --gpus all --net=host -e DISPLAY=$DISPLAY carlasim/carla:latest /bin/bash ./CarlaUE4.sh
This loads up the default CARLA window view - works.
We do not need to run the pythonAPI from inside the docker container. To grab the pythonAPI that should be compatible with the CARLA instance running inside the docker container, we can follow the steps with this tutorial.
Follow the Python3.7 installation steps in the same tutorial:
add-apt-repository ppa:deadsnakes/ppa
sudo apt-get install python3.7
sudo apt-get install python3-pip && python3.7-distutils
(i added python3.7-distutils)
pip install virtualenv
virtualenv --python=/usr/bin/python3.7 venv
source venv/bin/activate pip3 --version #it should display (python 3.7) pip3 install pygame numpy deactivate
Run CARLA in 1 terminal:
docker run \ -p 2000-2002:2000-2002 \ --cpuset-cpus="0-5" \ --runtime=nvidia \ --gpus 'all,"capabilities=graphics,utility,display,video,compute"' \ -e DISPLAY=$DISPLAY \ -v /tmp/.X11-unix:/tmp/.X11-unix \ -it \ carlasim/carla \ ./CarlaUE4.sh -opengl $1
Run PythonAPI in 2nd terminal:
cd PythonAPI
source venv/bin/activate
cd examples
./manual_control.py
The provided bash script seems to work okay, but it would be better if it used docker-compose to run both the PythonAPI and CARLA instance simultaneously without the user having to do anything.
Should figure out a way to run Autoware Universe with CARLA now. This https://autoware.org/running-multiple-autoware-powered-vehicles-in-carla-using-zenoh/ looks like a viable option, although may be overkill for in the short term.
To run the HIL demo, would need to just also put in a startup script:
when testing out the tutorial dylan posted, there will be a problem related to no octomap cmake or the like, so it can be solved by running sudo apt install ros-humble-octomap-ros
At the moment I am running into a problem related to grid_map_ros package which I am not entirely sure why it keeps failing.
does the OpenPlanner tutorial use Ros humble?
Nah it uses galactic, a version older
going to swap to using this https://github.com/carla-simulator/carla-autoware, as the open planner tutorial has quite a few bugs to fix especially when building the workspace (another issue came up for grid_map_pcl)
ran into another problem when following the instructions in the carla-autoware demo
going to continue seeing if i can debug the issue, but otherwise the zenoh carla thing dylan posted might be another option because i found the github page for it https://github.com/evshary/autoware_carla_launch
well this sucks, the zatitech thing we tried at first has this problem in their tutorial page recently when reading through the zenoh thing and saw that it was referenced
ok, so far for the zenoh setup, i've downloaded the bridge docker image
going to have to enter the container some time later and run the rest of these commands, as well as build the other docker container
so no errors so far??
Nope, so far so good which looks like a good sign
ok, just now got the bridge built, no errors so far
Don't panic if the folder location doesn't look right, what i understood what rocker does is that it "loads" the folders from your host machine into the docker container, and even if it gets removed every change to those folders stays so you don't lose progress (i think so far)
building the autoware packages in another container now (fingers crossed it works bcs i didn't bother checking if it uses localhost or not but eh we'll cross that bridge when it gets to it). It seems to be downloading a custom Zenoh Version of autoware, so going to take a while.
just finished building the autoware packages
both containers are now built, now only left to test the demo case to see if it works
ok, when running these commands for the demo, the map for carla did change, so at least that's working for now
but i'm not particularly sure when it's asking for the host1 ip (the pc running carla ) is the docker IP OR the actual host IP
well seems like it works, i took the docker IP after finding it using hostname -I
the IP address that starts with 172
ok, seems like i can get the car to move by setting the goal pose, but dang it is LAGGY
yep, it works, and confirmed on both the rviz side and CARLA sim side, but it's really laggy so running in headless mode for CARLA should be more sensible.
11-12-23
@Jokua to do some more testing with CARLA + Autoware-Universe
ok, a bit of an update on what I have done so far:
I have managed to reduce the burden on the pc by running CARLA in "headless mode", which means it's gonna run without the GUI so it saves us some more resources.
it can be done when creating a new docker container with this command docker run -p 2000-2002:2000-2002 --cpuset-cpus="0-5" --runtime=nvidia --gpus 'all,"capabilities=graphics,utility,display,video,compute"' -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -it carlasim/carla ./CarlaUE4.sh -opengl $1 -RenderOffScreen -quality-level=Epic
Also i've managed to make it run properly on my laptop (well once, will update if i run into any issues because there was some error that goes like sh: 1: xdg-user-dir: not found
when trying to follow the tutorial for setting up carla in your local env in this tutorial.
I have managed to run two instances as the demo has shown
I have also managed to get them both to move at the same time, though it is sort of laggy?
Also I don't know why it decided to stop running by itself after moving once, so that's probably another thing to make note of for troubleshooting later.
Additionally, there is a FAQ on the Zenoh's github page about how to change the map here
Still unsure on how to change the car's URDF or model, might have to look up on how carla spawns it or ask someone who has used CARLA before.
I have managed to reduce the burden on the pc by running CARLA in "headless mode", which means it's gonna run without the GUI so it saves us some more resources.
This would be very useful for the CI/CD pipeline guys @AnthonyZhOon @sxppro @npnquang
I have also managed to get them both to move at the same time, though it is sort of laggy?
If you record a rosbag and play it back again, is it still laggy?
If you record a rosbag and play it back again, is it still laggy?
I had to look up what a rosbag is, but how would I do that exactly?
Also I'll update the wiki on how to set it up and use it in the beast as well, since I've confirmed it can work on my laptop (be warned it takes ages if your internet is shite to download the zenoh autoware bridge and autoware docker images)
@Jokua if you're interested https://github.com/orgs/autowarefoundation/discussions/2828#discussioncomment-7929757
oh, thanks! I'll check it out, hopefully the guy updated some things
@Jokua to do some more testing for the next 2 days
I have just finished some testing, seems like the problem I had about not being able to set another route may be just slight user error, apart from that recorded quite a lengthy video (with some cropping issues, i accidentally captures my other screen as well, as well as the fact i couldn't record my own voice). But otherwise, the basic functionality seems to be working for a single car RViz running, i spawned two cars but only operated one due to my laptop spec contraints.
CARLA Debian package only has support for Ubuntu 18.04 and Ubuntu 22.04