Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* Improved V2X sensor capabilities: send complex custom user-defined data, support V2I sensors not attached to a vehicle
* Introduced fine grained ServerSynchronization mechanism: each client decides for its own if it requires synchronization or not and provides its own synchronization window.
Be aware: some existing code using master/slave sync mechanism might need rework. See also generate_traffic.py.
* Added ad-rss type-stubs for the PythonAPI when building with RSS support

## CARLA 0.9.16

Expand Down Expand Up @@ -66,6 +67,7 @@
* Added `set_wheel_pitch_angle()` to change the bone pitch angle of each wheel of a vehicle
* Added `get_wheel_pitch_angle()` to get the rotation (pitch) angle of a vehicle wheel


## CARLA 0.9.15

* Added Digital Twins feature version 0.1. Now you can create your own map based on OpenStreetMaps
Expand Down
44 changes: 40 additions & 4 deletions PythonAPI/carla/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.

import shutil
from setuptools import setup, Extension

import fnmatch
import os
import sys

from distutils.command.install_lib import install_lib

def is_rss_variant_enabled():
if 'BUILD_RSS_VARIANT' in os.environ and os.environ['BUILD_RSS_VARIANT'] == 'true':
return True
Expand Down Expand Up @@ -136,8 +139,8 @@ def walk(folder, file_filter='*'):
else:
raise NotImplementedError

depends = [x for x in walk('source/libcarla')]
depends += [x for x in walk('dependencies')]
depends = list(walk('source/libcarla'))
depends += list(walk('dependencies'))

def make_extension(name, sources):

Expand All @@ -164,11 +167,42 @@ def get_license():
with open("README.md") as f:
long_description = f.read()

class CleanADStubFiles(install_lib):
"""
Removes the ad/ files from the build directory in a normal built
that else would be copies over.
"""

CARLA_RSS_STUB_FILE = "__carla_rss.pyi"
_CARLA_RSS_STUB_FILE_PATH = os.path.join("carla", CARLA_RSS_STUB_FILE)
CARLA_AD_STUB_DIR = os.path.join("carla", "ad")

def run(self):
if not is_rss_variant_enabled():
self.prune_rss()
install_lib.run(self) # for python2 do not use super here

def prune_rss(self):
"""Removes files from an rss build that we do not want to be copied over to a non-rss build."""
if not self.build_dir:
return
print("Cleaning possible RSS files from previous build.")
shutil.rmtree(os.path.join(self.build_dir, self.CARLA_AD_STUB_DIR), ignore_errors=True)
try:
os.remove(os.path.join(self.build_dir, self._CARLA_RSS_STUB_FILE_PATH))
except OSError:
pass
return

setup(
name='carla',
version='0.9.16',
package_dir={'': 'source'},
packages=['carla'],
# Avoid "Package would be ignored" warning for non-rss build if using ['carla'] here
packages=['carla', 'carla.ad', 'carla.ad.rss', 'carla.ad.map'] if is_rss_variant_enabled() else ['carla'],
# For non-rss build do a fine grained include/exclude on the package data.
package_data={'carla' : [""]},
exclude_package_data={} if is_rss_variant_enabled() else {'carla':[CleanADStubFiles.CARLA_RSS_STUB_FILE]},
ext_modules=get_libcarla_extensions(),
license=get_license(),
description='Python API for communicating with the CARLA server.',
Expand All @@ -177,4 +211,6 @@ def get_license():
url='https://github.com/carla-simulator/carla',
author='The CARLA team',
author_email='[email protected]',
include_package_data=True)
include_package_data=True,
cmdclass={'install_lib': CleanADStubFiles},
)
Loading