Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Feature: Dreamview remote controller for carla #174

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

cfs4819
Copy link
Contributor

@cfs4819 cfs4819 commented Dec 28, 2023

Description

Referring to LGSVL's dreamview, built a dreamview for carla_bridge.

Dreamview-remote can help :

  • Setting destination by set_destination_tranform()
  • Enabling/Disabling modules
  • Selecting HDMaps in Dreamview
  • Selecting vehicle models in Dreamview
  • Getting modules' status
  • .etc

For example, we can select a destination by

# set host and port 
host = 'localhost'
port = 2000

# connect
carla_client = carla.Client(host, port)
carla_world = carla_client.get_world()
carla_map = carla_world.get_map()

# find ego_vehicle 
ego_vehicle = None
all_vehicles = self.carla_world.get_actors().filter("*vehicle.*")
for vehicle in all_vehicles:
    if vehicle.attributes["role_name"] == "ego_vehicle":
        ego_vehicle = vehicle
        break

# get a avaliabel destination transform
dest_transform = random.choice(carla_map.get_spawn_points())

# connect dreamview
from carla_bridge.dreamview_carla import dreamview
dv = dreamview.Connection(
                    ego_vehicle,
                    ip=dreamview_ip,
                    port=str(dreamview_port))

# setup modules and pub destination
modules = [
            'Transform',  # ok
            'Routing',
            'Prediction',  # ok
            'Planning',  # ok
            'Control',
            'Storytelling'  # ok
] 
dv.enable_apollo(dest_transform, modules)

Then we can notice vehicle driving.

Issue reference

Please reference the issue this PR will close: #90 #44

Checklist

  • Code compiles correctly
  • Created/updated tests
  • Unit tests passing
  • End-to-end tests passing
  • Reference document

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant