forked from carla-simulator/ros-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request carla-simulator#2 from carla-simulator/master
Update
- Loading branch information
Showing
33 changed files
with
1,452 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
*.pyc | ||
build.gradle | ||
CMakeLists.txt | ||
/CMakeLists.txt | ||
.catkin_workspace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[TYPECHECK] | ||
ignored-modules=numpy,carla | ||
ignored-modules=numpy,carla,pygame | ||
disable=logging-format-interpolation,locally-disabled,cyclic-import,too-many-instance-attributes,invalid-name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
carla_ackermann_control/launch/carla_ros_bridge_with_ackermann_control.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
<!-- --> | ||
<launch> | ||
<arg name='host' default='localhost'/> | ||
<arg name='port' default='2000'/> | ||
|
||
<include file="$(find carla_ros_bridge)/launch/carla_ros_bridge.launch" pass_all_args="true"/> | ||
<include file="$(find carla_ackermann_control)/launch/carla_ackermann_control.launch"/> | ||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
cmake_minimum_required(VERSION 2.8.3) | ||
project(carla_ego_vehicle) | ||
|
||
find_package(catkin REQUIRED COMPONENTS | ||
rospy | ||
) | ||
|
||
catkin_python_setup() | ||
|
||
catkin_package( | ||
CATKIN_DEPENDS | ||
rospy | ||
) | ||
|
||
catkin_install_python(PROGRAMS | ||
src/carla_ego_vehicle/carla_example_ego_vehicle.py | ||
src/carla_ego_vehicle/carla_ego_vehicle_base.py | ||
src/carla_ego_vehicle/carla_ros_manual_control.py | ||
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} | ||
) | ||
|
||
install(DIRECTORY launch/ | ||
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# ROS Ego Vehicle | ||
|
||
This package provides two ROS nodes: | ||
|
||
- Carla Example Ego Vehicle: A reference client for spawning an ego vehicle | ||
- Carla ROS Manual Control: a ROS-only manual control | ||
|
||
|
||
## Carla Example Ego Vehicle | ||
|
||
The reference Carla client `carla_example_ego_vehicle` can be used to spawn an ego vehicle (role-name: "ego_vehicle") with the following sensors attached to it. | ||
|
||
- GNSS | ||
- LIDAR | ||
- Cameras (one front-camera + one camera for visualization in carla_ros_manual_control) | ||
- Collision Sensor | ||
- Lane Invasion Sensor | ||
|
||
Info: To be able to use carla_ros_manual_control a camera with role-name 'view' is required. | ||
|
||
If no specific position is set, the ego vehicle is spawned at a random position. | ||
|
||
|
||
### Spawning at specific position | ||
|
||
It is possible to (re)spawn the ego vehicle at the specific location by publishing to `/initialpose`. | ||
|
||
The preferred way of doing that is using RVIZ: | ||
|
||
![Autoware Runtime Manager Settings](../docs/images/rviz_set_start_goal.png) | ||
|
||
Selecting a Pose with '2D Pose Estimate' will delete the current ego_vehicle and respawn it at the specified position. | ||
|
||
|
||
### Create your own sensor setup | ||
|
||
To setup your own ego vehicle with sensors, follow a similar approach as in `carla_example_ego_vehicle` by subclassing from `CarlaEgoVehicleBase`. | ||
|
||
Define sensors with their attributes as described in the Carla Documentation about [Cameras and Sensors](https://github.com/carla-simulator/carla/blob/master/Docs/cameras_and_sensors.md). | ||
|
||
The format is a list of dictionaries. One dictionary has the values as follows: | ||
|
||
{ | ||
'type': '<SENSOR-TYPE>', | ||
'role_name': '<NAME>', | ||
'x': 0.0, 'y': 0.0, 'z': 0.0, 'roll': 0.0, 'pitch': 0.0, 'yaw': 0.0, # pose of the sensor, relative to the vehicle | ||
<ADDITIONAL-SENSOR-ATTRIBUTES> | ||
} | ||
|
||
## Carla ROS Manual Control | ||
|
||
The node `carla_ros_manual_control` is a ROS-only version of the Carla `manual_control.py`. All data is received | ||
via ROS topics. | ||
|
||
Note: To be able to use carla_ros_manual_control a camera with role-name 'view' needs to be spawned by `carla_ego_vehicle`. | ||
|
||
|
||
### Manual steering | ||
|
||
In order to steer manually, you might need to disable sending vehicle control commands within another ROS node. | ||
|
||
Therefore the manual control is able to publish to `/vehicle_control_manual_override` ([std_msgs/Bool](http://docs.ros.org/api/std_msgs/html/msg/Bool.html)). | ||
|
||
Press `B` to toggle the value. | ||
|
||
Note: As sending the vehicle control commands is highly dependent on your setup, you need to implement the subscriber to that topic yourself. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- --> | ||
<launch> | ||
<arg name='host' default='localhost'/> | ||
<arg name='port' default='2000'/> | ||
<arg name="vehicle_filter" default="vehicle.*" /> | ||
|
||
<param name="/carla/host" value="$(arg host)" /> | ||
<param name="/carla/port" value="$(arg port)" /> | ||
<param name="/carla/client/vehicle_filter" value="$(arg vehicle_filter)" /> | ||
|
||
<node pkg="carla_ego_vehicle" type="carla_example_ego_vehicle.py" name="carla_example_ego_vehicle" output="screen"/> | ||
</launch> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- --> | ||
<launch> | ||
|
||
<node pkg="carla_ego_vehicle" type="carla_ros_manual_control.py" name="carla_ros_manual_control" output="screen"/> | ||
|
||
</launch> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>carla_ego_vehicle</name> | ||
<version>0.0.0</version> | ||
<description>The carla_ego_vehicle package</description> | ||
<maintainer email="[email protected]">CARLA Simulator Team</maintainer> | ||
<license>MIT</license> | ||
<buildtool_depend>catkin</buildtool_depend> | ||
<build_depend>rospy</build_depend> | ||
<build_export_depend>rospy</build_export_depend> | ||
<exec_depend>rospy</exec_depend> | ||
<export> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from distutils.core import setup | ||
from catkin_pkg.python_setup import generate_distutils_setup | ||
|
||
d = generate_distutils_setup( | ||
packages=['carla_ego_vehicle'], | ||
package_dir={'': 'src'} | ||
) | ||
|
||
setup(**d) | ||
|
Empty file.
Oops, something went wrong.