Shreyas321
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
      • Invitee
    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Versions and GitHub Sync Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
Invitee
Publish Note

Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

Your note will be visible on your profile and discoverable by anyone.
Your note is now live.
This note is visible on your profile and discoverable online.
Everyone on the web can find and read all notes of this public team.
See published notes
Unpublish note
Please check the box to agree to the Community Guidelines.
View profile
Engagement control
Commenting
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
  • Everyone
Suggest edit
Permission
Disabled Forbidden Owners Signed-in users Everyone
Enable
Permission
  • Forbidden
  • Owners
  • Signed-in users
Emoji Reply
Enable
Import from Dropbox Google Drive Gist Clipboard
   owned this note    owned this note      
Published Linked with GitHub
Subscribed
  • Any changes
    Be notified of any changes
  • Mention me
    Be notified of mention me
  • Unsubscribe
Subscribe
# Carla Simulator ### Installation The following requirements should be fulfilled before installing CARLA: • System requirements. CARLA is built for Windows and Linux systems. • An adequate GPU. CARLA aims for realistic simulations, so the server needs at least a 6 GB GPU although 8 GB is recommended, especially when dealing with machine learning. • Disk space. CARLA will use about 20 GB of space. • Python. Python is the main scripting language in CARLA. On Linux, CARLA supports Python 2.7 and Python 3.7. On windows, Python 3.7 only is supported. • Pip. Some installation methods of the CARLA client library require pip or pip3 (depending on your Python version) version 20.3 or higher. 2 Linux Installation The Debian package is available for both Ubuntu 18.04 and Ubuntu 20.04. 2.1 Install the Carla Server on Linux • Set up the Debian repository in the system (each of the two commands bellow is to be run as a single line): ``` $ sudo apt-key adv --keyserver keyserver.ubuntu.com --recvkeys 1AF1527DE64CB8D9 $ sudo add-apt-repository "deb [arch=amd64] http://dist.carla. org/carla(lsb_release -sc) main" ``` • Update the package lists and install the Carla server: ``` $ sudo apt-get update $ sudo apt-get install carla-simulator ``` • Import additional assets: Each Carla release has it’s own additional package of extra assets and maps. These additional assets can be installed with the command bellow: ``` $ cd /opt/carla-simulator $ ./ImportAssets.sh ``` • Test your server installation: You can start the Carla server with the following command: `$ ./CarlaUE4.sh` A window containing a view over the city will pop up. This is the spectator view. To fly around the city use the mouse and W A D S keys, holding down the right mouse button to control the direction. This is the server simulator which is now running and waiting for a client to connect and interact with the world. Troubleshooting Some problem might arise when runing the server. These problem are reviewed below: • You get the error message: “error while loading shared libraries: libomp.so.5: cannot open shared object file: No such file or directory”. This error is solved by installing libomp5: `$ sudo apt install libomp5` • If you have 2 graphic cards (Intel and Nvidia) installed, Carla tend to select the first active GPU device (which is often Intel GPU), even if you have selected Nvidia in PRIME. This leads to a segmentation fault. To overcome this, you have to tell Carla to prefer the Nvidia GPU: `$ ./CarlaUE4.sh -preferNvidia` • If you are installing Carla on a remote machine, forwarding the Carla server GUI will fail. To solve this, you will need to start Carla in Off-screen mode. In this mode, unreal Engine is working as usual, rendering is computed but there is no display available. GPU based sensors return data as usual. `$ ./CarlaUE4.sh -RenderOffScreen` 2.2 Install Carla Client on Linux The Carla client API is implemented in Python. 2.2.1 Create a Conda Environment (optional) It is highly recommended to install the CARLA client library in a conda virtual environment to avoid packages conflicts whit your other projects. Note for example that Carla requires python 3.7 (or python 2.7). If your are not familiar with the Anaconda python distribution, see how to installit on Linux in Appendix 4.2. Assuming you have Anaconda installed, create a virtual environment (named carla for example) with python 3.7 and activate it: ``` $ conda create -n carla python=3.7 $ conda activate carla ``` 2.2.2 Check your Pip Version • Pip3 requires version 20.3 or higher. Check your pip3 version: $ pip3 -V If needed, upgrade pip3: `$ pip3 install --upgrade pip` • Install the python dependencies: ``` $ pip3 install pygame opencv-python $ conda install numpy matplotlib ``` 2.2.3 Install the Client You are now ready to install the carla client in your created virtual environment. CARLA provides .whl files for different Python versions. There can be found in PythonAPI/carla/dist/. There is one file per supported Python version, indicated by the file name. Install the one corresponding to your carla server- and python version (0.9.13 & 3.7 at the time of writing): ``` $ cd /opt/carla-simulator/PythonAPI/carla/dist $ pip3 install carla-0.9.13-cp37-cp37m-manylinux_2_27_x86_64.whl ``` 2.3 Test your Complete Linux Installation You can test your complete installation (client & server) by running the demo_run_carla.py script provided with this installation guide. An Opencv windows will pop up displaying a car driving around. Note that you must run this script within your carla conda environment and the server has to be runing (started via ./CarlaUE4.sh). 3. Windows Installation 3.1 Download the Carla Server for Windows • Download the latest release (0.9.13 at the time of writing) of the carla package as well as the AdditionalMaps from here as shown in the figure below: • Extract the Carla package (CARLA_0.9.13) in the folder of your choice. • Extract the contents of AdditionalMaps_0.9.13 directly in th carla root folder, that is the folder where other carla module like CarlaUE4, Engine, etc,are located. The resulting structure will look like the figure bellow: • Test your server installation: You can start the Carla server by double clicking on the executable CarlaUE4.exe circled in red in the figure above. A window containing a view over the city will pop up. This is the spectator view. To fly around the city use the mouse and W A D S keys, holding down the right mouse button to control the direction. This is the server simulator which is now running and waiting for a client to connect and interact with the world. Troubleshooting You get an error “The following component(s) are required to run this program DirectX Runtime”. To solve this issue, download and install directX from here. 3.2 Install the Carla Client for Windows • Create conda virtual environment (Optional but recommended): It is highly recommended to install the CARLA client library in a conda virtual environment to avoid packages conflicts whit your other projects. Note for example that Carla requires python 3.7 (or python 2.7). If your are not familiar with the Anaconda python distribution, see how to install it on Windows in Appendix 4.1. Assuming you have Anaconda installed, create a conda virtual environment(named carla for example) with python 3.7 and activate it: ``` $ conda create -n carla python=3.7 $ conda activate carla ``` • Install the python dependencies: ``` $ pip3 install pygame opencv-python $ conda install numpy matplotlib ``` • Install the client via the whl file: CARLA provides .whl files for different Python versions. There can be found in PythonAPI/carla/dist/. There is one file per supported Python version,indicated by the file name. In the conda command prompt, navigate to the directory where you extracted Carla, then navigate to PythonAPI/carla/dist/ and run the following command to install the client corresponding to your carla server- and python version (0.9.13 & 3.7 at the time of writing): `$ pip3 install carla-0.9.13-cp37-cp37m-win_amd64.whl` The process is shown in the figure bellow: 3.3 Test your Complete Windows Installation You can test your complete installation (client & server) by running the demo_run_carla.py script provided with this installation guide. An Opencv windows will pop up displaying a car driving around.Note that you must run this script within your carla conda environment and the server has to be runing (started via CarlaUE4.exe). ### Launhing Carla-- 1. In terminal go to Carla_Simulator Folder 2. deactivate Conda encironment --conda deactivate 3. Run shell file -- ./CarlaUE4.sh 4. default carla window will popup on screen. ### Simulation -- 1. PythonAPI's are used to perform simulations on carla. 2. Carla_Simulator/pythonAPI/examples have examle API scripts for better understanding of carla. 3. To run API script open this folder in terminsl then deactivate the conda environment. 4. run python name.py command to run the required API. ### PythonAPI -- These are the files used to manipulate carla and perform simulation on it. Basic structure of API. ### client * We need to connect Carla server to open port. Client controls simulator using client and world object. 1. client= carla.Client('localhost',2000) 2. world=client.get_world() Client object serves to maintain client's connection. We can set any available port, port 2000 is set as default. * we need map for simulation. worls object provides access to map element. 1. client.load_world('Town05') * We can use spectator view to obsereve surrounding. we can use mouse to control pitch and yaw, QASD to control its movement. 1. spect=world.get_spectator() 2. transform=spect.get_transform() 3. location=tarnsform.location 4. spect.set_transform(transform1)-- this command will set spectator to given transfrom. ### Actors * We required actors for simulation. Actors in carla are anything which performs actions within simulation. Actors in Carla involves Vehicles,Walkers,sensors,traffic Signs,traffic lights,spectator. * Bluprints are the layouts allow the user to smoothly incorporate new actors in simulation,they are already made models with animations and series of attributes. * All available bluprints are lsited in bluprints library. #### Spawning * first we have to take bluprint library to load actor. 1. bplib = world.get_bluprint_library() * in this library we can find actor we want 1. vehicle_bp=bplib.find('vehicle.tesla_model3') -- it will find tesla_model3 in library. * now we required spawn points to spawn the vehicles. 1. spawn_points= world.get_map().get_spawn_points() -- it will search available locations to spawn the vehicles in map and give list of spawn points. * now we can spawn our vehicle in carla. 1. ego=world.spawn_actor(vehicle_bp,spawn_points[0])-- we can use world.try_spawn_actor() command to spawn the vehicle. 2. try_spawn_actor() don't give any error if any collision happen at spawn points and continue to run the script. * to spawn other actors like sensors we follow same procedure, but only chane we have to do is we have to attach them to any vehicle. 1. camera_bp=bplib.find('sensor.camera.rgb') 2. camera=world.spawn_actor(camera_bp,spawn_points[0],attach_to=ego) #### vehicle -- Vehicles are special type of actor in carla.It incorporates special type of components that simulates physcics of wheeled vehicles. This achived by applying types of different controls. * carla.vehicle_control provides input for driving commands such as throttle,brake,steer etc. 1. ego.apply_control(carla.Vehicle_Control(throttle=1,steer=0)) * we can set vehicle to auto-pilot by using command 1. ego.set_autopilot(True) * getter and setter function:- 1. ego.get_transform -- transform object of ego vehicle as output(location and it orientation) 2. ego.get_transform().get_location -- give location of ego vehicle from transform object. 3. ego.get_velocity() -- it give's velocity of vehicles in x,y,z direction. 4. ego.get_accleration()-- it will give acceleration of vehicle. 5. ego.set_target_velocity()-- set car to desired velocity. 6. ego.set_location() -- teleports actor to given location. 7. ego.set_transform() -- teleports the actor to given transform(location+rotation)

Import from clipboard

Paste your markdown or webpage here...

Advanced permission required

Your current role can only read. Ask the system administrator to acquire write and comment permission.

This team is disabled

Sorry, this team is disabled. You can't edit this note.

This note is locked

Sorry, only owner can edit this note.

Reach the limit

Sorry, you've reached the max length this note can be.
Please reduce the content or divide it to more notes, thank you!

Import from Gist

Import from Snippet

or

Export to Snippet

Are you sure?

Do you really want to delete this note?
All users will lose their connection.

Create a note from template

Create a note from template

Oops...
This template has been removed or transferred.
Upgrade
All
  • All
  • Team
No template.

Create a template

Upgrade

Delete template

Do you really want to delete this template?
Turn this template into a regular note and keep its content, versions, and comments.

This page need refresh

You have an incompatible client version.
Refresh to update.
New version available!
See releases notes here
Refresh to enjoy new features.
Your user state has changed.
Refresh to load new user state.

Sign in

Forgot password

or

By clicking below, you agree to our terms of service.

Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
Wallet ( )
Connect another wallet

New to HackMD? Sign up

Help

  • English
  • 中文
  • Français
  • Deutsch
  • 日本語
  • Español
  • Català
  • Ελληνικά
  • Português
  • italiano
  • Türkçe
  • Русский
  • Nederlands
  • hrvatski jezik
  • język polski
  • Українська
  • हिन्दी
  • svenska
  • Esperanto
  • dansk

Documents

Help & Tutorial

How to use Book mode

Slide Example

API Docs

Edit in VSCode

Install browser extension

Contacts

Feedback

Discord

Send us email

Resources

Releases

Pricing

Blog

Policy

Terms

Privacy

Cheatsheet

Syntax Example Reference
# Header Header 基本排版
- Unordered List
  • Unordered List
1. Ordered List
  1. Ordered List
- [ ] Todo List
  • Todo List
> Blockquote
Blockquote
**Bold font** Bold font
*Italics font* Italics font
~~Strikethrough~~ Strikethrough
19^th^ 19th
H~2~O H2O
++Inserted text++ Inserted text
==Marked text== Marked text
[link text](https:// "title") Link
![image alt](https:// "title") Image
`Code` Code 在筆記中貼入程式碼
```javascript
var i = 0;
```
var i = 0;
:smile: :smile: Emoji list
{%youtube youtube_id %} Externals
$L^aT_eX$ LaTeX
:::info
This is a alert area.
:::

This is a alert area.

Versions and GitHub Sync
Get Full History Access

  • Edit version name
  • Delete

revision author avatar     named on  

More Less

Note content is identical to the latest version.
Compare
    Choose a version
    No search result
    Version not found
Sign in to link this note to GitHub
Learn more
This note is not linked with GitHub
 

Feedback

Submission failed, please try again

Thanks for your support.

On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

Please give us some advice and help us improve HackMD.

 

Thanks for your feedback

Remove version name

Do you want to remove this version name and description?

Transfer ownership

Transfer to
    Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

      Link with GitHub

      Please authorize HackMD on GitHub
      • Please sign in to GitHub and install the HackMD app on your GitHub repo.
      • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
      Learn more  Sign in to GitHub

      Push the note to GitHub Push to GitHub Pull a file from GitHub

        Authorize again
       

      Choose which file to push to

      Select repo
      Refresh Authorize more repos
      Select branch
      Select file
      Select branch
      Choose version(s) to push
      • Save a new version and push
      • Choose from existing versions
      Include title and tags
      Available push count

      Pull from GitHub

       
      File from GitHub
      File from HackMD

      GitHub Link Settings

      File linked

      Linked by
      File path
      Last synced branch
      Available push count

      Danger Zone

      Unlink
      You will no longer receive notification when GitHub file changes after unlink.

      Syncing

      Push failed

      Push successfully