Skip to content

Commit

Permalink
Merge branch 'master' into documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nsubiron committed Mar 21, 2018
2 parents 2bd96d7 + 2196977 commit 810b84e
Show file tree
Hide file tree
Showing 23 changed files with 164 additions and 97 deletions.
6 changes: 3 additions & 3 deletions Docs/Example.CarlaSettings.ini
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ SeedPedestrians=123456789
; Uncomment next line to add a camera called MyCamera to the vehicle
; Sensors=MyCamera

; or uncomment next line to add a camera and a LiDAR
; or uncomment next line to add a camera and a Lidar
; Sensors=MyCamera,MyLidar

; or uncomment next line to add a regular camera and a depth camera
Expand All @@ -60,7 +60,7 @@ SeedPedestrians=123456789
[CARLA/Sensor/MyCamera]
; Type of the sensor. The available types are:
; * CAMERA A scene capture camera.
; * LIDAR_RAY_TRACE A LiDAR implementation based on ray-tracing.
; * LIDAR_RAY_CAST A Lidar implementation based on ray-casting.
SensorType=CAMERA
; Post-processing effect to be applied to this camera. Valid values:
; * None No effects applied.
Expand Down Expand Up @@ -90,7 +90,7 @@ PostProcessing=Depth


[CARLA/Sensor/MyLidar]
SensorType=LIDAR_RAY_TRACE
SensorType=LIDAR_RAY_CAST
; Number of lasers.
Channels=32
; Measure distance in meters.
Expand Down
10 changes: 5 additions & 5 deletions Docs/cameras_and_sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ moment there are four different sensors available.
* [Camera: Scene final](#camera-scene-final)
* [Camera: Depth map](#camera-depth-map)
* [Camera: Semantic segmentation](#camera-semantic-segmentation)
* [Ray-trace based lidar](#ray-trace-based-lidar)
* [Ray-cast based lidar](#ray-cast-based-lidar)

!!! note
The images are sent by the server as a BGRA array of bytes. The provided
Expand Down Expand Up @@ -219,12 +219,12 @@ RotationRoll=0
RotationYaw=0
```

Ray-trace based Lidar
---------------------
Ray-cast based Lidar
--------------------

![LidarPointCloud](img/lidar_point_cloud.gif)

A rotating Lidar implemented with ray-tracing. The points are computed by adding
A rotating Lidar implemented with ray-casting. The points are computed by adding
a laser for each channel distributed in the vertical FOV, then the rotation is
simulated computing the horizontal angle that the Lidar rotated this frame, and
doing a ray-cast for each point that each laser was supposed to generate this
Expand Down Expand Up @@ -264,7 +264,7 @@ carla_settings.add_sensor(lidar)

```ini
[CARLA/Sensor/MyLidar]
SensorType=LIDAR_RAY_TRACE
SensorType=LIDAR_RAY_CAST
Channels=32
Range=50
PointsPerSecond=100000
Expand Down
60 changes: 30 additions & 30 deletions PythonClient/carla/carla_server_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion PythonClient/carla/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def __init__(self, s):
sensor_def = SensorDefinition(s)
if sensor_def.type == carla_protocol.Sensor.CAMERA:
sensor_def.parse_raw_data = parse_image
elif sensor_def.type == carla_protocol.Sensor.LIDAR_RAY_TRACE:
elif sensor_def.type == carla_protocol.Sensor.LIDAR_RAY_CAST:
sensor_def.parse_raw_data = parse_lidar
else:
logging.error('unknown sensor type %s', sensor_def.type)
Expand Down
4 changes: 2 additions & 2 deletions PythonClient/carla/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ class Lidar(Sensor):
"""

def __init__(self, name, **kwargs):
super(Lidar, self).__init__(name, sensor_type="LIDAR_RAY_TRACE")
super(Lidar, self).__init__(name, sensor_type="LIDAR_RAY_CAST")
self.Channels = 32
self.Range = 5000.0
self.Range = 50.0
self.PointsPerSecond = 56000
self.RotationFrequency = 10.0
self.UpperFovLimit = 10.0
Expand Down
11 changes: 9 additions & 2 deletions PythonClient/client_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def run_carla_client(args):
SendNonPlayerAgentsInfo=True,
NumberOfVehicles=20,
NumberOfPedestrians=40,
WeatherId=random.choice([1, 3, 7, 8, 14]))
WeatherId=random.choice([1, 3, 7, 8, 14]),
QualityLevel=args.quality_level)
settings.randomize_seeds()

# Now we want to add a couple of cameras to the player vehicle.
Expand All @@ -76,7 +77,7 @@ def run_carla_client(args):
lidar.set_rotation(0, 0, 0)
lidar.set(
Channels=32,
Range=5000,
Range=50,
PointsPerSecond=100000,
RotationFrequency=10,
UpperFovLimit=10,
Expand Down Expand Up @@ -201,6 +202,12 @@ def main():
'-l', '--lidar',
action='store_true',
help='enable Lidar')
argparser.add_argument(
'-q', '--quality-level',
choices=['Low', 'Epic'],
type=lambda s: s.title(),
default='Epic',
help='graphics quality level, a lower level makes the simulation run considerably faster.')
argparser.add_argument(
'-i', '--images-to-disk',
action='store_true',
Expand Down
Loading

0 comments on commit 810b84e

Please sign in to comment.