Giter VIP home page Giter VIP logo

carla-ai's Introduction

carla-ai

AI for Carla Simulator

Installation

  • Install ROS Noetic
  • Follow the official guide to install Carla
  • Install Carla ROS Bridge. The following changes should be made in order to compile it on Ubuntu 20.04
    diff --git a/carla_ros_bridge/src/carla_ros_bridge/bridge.py b/carla_ros_bridge/src/carla_ros_bridge/bridge.py
    index dd7838b..0a7683d 100755
    --- a/carla_ros_bridge/src/carla_ros_bridge/bridge.py
    +++ b/carla_ros_bridge/src/carla_ros_bridge/bridge.py
    @@ -531,7 +531,7 @@ def main():
                    CarlaRosBridge.CARLA_VERSION, dist.version))
                sys.exit(1)
    
    -        if LooseVersion(carla_client.get_server_version()) < \
    +        if False and LooseVersion(carla_client.get_server_version()) < \
                LooseVersion(CarlaRosBridge.CARLA_VERSION):
                rospy.logfatal("CARLA Server version {} required. Found: {}".format(
                    CarlaRosBridge.CARLA_VERSION, carla_client.get_server_version()))
    diff --git a/carla_ros_bridge/src/carla_ros_bridge/lidar.py b/carla_ros_bridge/src/carla_ros_bridge/lidar.py
    index cd920d1..0201f88 100644
    --- a/carla_ros_bridge/src/carla_ros_bridge/lidar.py
    +++ b/carla_ros_bridge/src/carla_ros_bridge/lidar.py
    @@ -57,7 +57,7 @@ class Lidar(Sensor):
            ]
    
            lidar_data = numpy.fromstring(
    -            carla_lidar_measurement.raw_data, dtype=numpy.float32)
    +            carla_lidar_measurement.raw_data.tobytes(), dtype=numpy.float32)
            lidar_data = numpy.reshape(
                lidar_data, (int(lidar_data.shape[0] / 4), 4))
            # we take the oposite of y axis
    diff --git a/pcl_recorder/CMakeLists.txt b/pcl_recorder/CMakeLists.txt
    index 068ed8b..f6a8fc1 100644
    --- a/pcl_recorder/CMakeLists.txt
    +++ b/pcl_recorder/CMakeLists.txt
    @@ -1,7 +1,7 @@
    cmake_minimum_required(VERSION 2.8.3)
    project(pcl_recorder)
    
    -add_compile_options(-std=c++11)
    +add_compile_options(-std=c++14)
    
    find_package(catkin REQUIRED COMPONENTS pcl_conversions pcl_ros roscpp
                                            sensor_msgs roslaunch)
  • Install the following libraries
    sudo apt install python-is-python3 python3-rosdep libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev
  • Install libxerces-c v3.1
    git clone [email protected]:apache/xerces-c.git -v v3.1.4
    cd xerces-c
    ./reconf
    ./configure
    make
    cp src/.libs/libxerces-c-3.1.so /usr/lib/
  • Create a conda environment from the environment.yaml file in this repository and activate it
    conda env create -f environment.yaml
    conda activate carla-ai
  • Create a catkin workspace
    mkdir catkin_ws/src
    cd catkin_ws/src
    ln -s /path/to/ros-bridge
    ln -s /path/to/carla-ai
    cd ..
    sudo rosdep init
    rosdep update
    rosdep install --from-paths src --ignore-src -r
    catkin_make
  • Define the following environment variables
    export ACADOS_HOME="/path/to/acados"
    export CARLA_HOME="/path/to/carla"
    export CARLA_CATKIN_WS_PATH="/path/to/catkin_ws"
  • Source the development script
    source /path/to/carla-ai/scripts/devel.zsh

Running

  1. Run Carla For headless mode execute

    DISPLAY= /opt/carla-0.9.10.1/CarlaUE4.sh -opengl

    or for normal mode execute

    /opt/carla-0.9.10.1/CarlaUE4.sh
  2. Run ros-bridge

    roslaunch carla_ros_bridge carla_ros_bridge.launch town:=Town06
  3. Run the Carla AI module

    roslaunch carla_ai carla_ai.launch
  4. Run waypoint-publisher

    roslaunch carla_waypoint_publisher carla_waypoint_publisher.launch

carla-ai's People

Contributors

nyukhalov avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.