carla-simulator / ros-bridge

ROS bridge for CARLA Simulator
MIT License
522 stars 422 forks source link

Carla_ad_demo Scenario #316

Closed Roosstef closed 4 years ago

Roosstef commented 4 years ago

Hi all,

is there a way to run other scenarios from scenario runner for example FollowLeadingVehicle.xml? When I try to run FollowLeadingVehicle.xml within the carla_ad_demo.launch the following error occures:

Sceanrio_Runner_error

fpasch commented 4 years ago

That's possible. But only open scenarios are supported. Please be aware, that we're currently reworking the scenario execution in #309

Roosstef commented 4 years ago

thanks for the fast respond! Currently only the FollowLeadingVehicle.xosc included in the ros_bridge can be used right? Other .xosc files from scenario_runner cant be used?

The Target Vehicle FollowLeadingVehicle.xosc included in the ros_bridge is not moving in my case. Am I doing something wrong?

fpasch commented 4 years ago

You can of course use other openscenarios. Just include them here: https://github.com/carla-simulator/ros-bridge/blob/master/carla_ad_demo/launch/carla_ad_demo_with_scenario.launch#L77

Regarding the vehicle not moving, please try it again with the latest master. We've updated the scenario.

Roosstef commented 4 years ago

Ok thank you, but the default scenarios (.xosc) from open_scenario cant run out of the box with carla_ad_demo.launch right? There are some parameters that need to be changed in the (.xosc) files like ScenarioObject are named hero, not ego_vehicle etc.?

fpasch commented 4 years ago

These example scenarios might need some modifications:

In general, there are two options to instantiate an AD stack together with a scenario:

  1. Instantiate it by defining it in the scenario (see #318 for some documentation)
  2. Instantiate it externally (then you might need to provide the route and target-speed yourself)
Roosstef commented 4 years ago

I dont understand how to specifiy a detination for the ego_vehicle within the scenario file. For example when I try to run the CyclistCrossing.xosc the ego_vehicle follows a random (?) waypoint and is not driving in the direction where the cyclist is. By manually setting the waypoint next to the cyclist via rviz it is working but I want that to be handled automatically. Is there a way to?

In the older version we were allowed to set a waypoint via the CarlaScenarioList publisher?

Thanks for your help! Sry but I'm new to OpenScenario.

fpasch commented 4 years ago

Setting the waypoints and the target speed is now possible within the openscenario. Example:

<Action name="EgoVehicleRouteAction">
    <PrivateAction>
        <RoutingAction>
            <AssignRouteAction>
                <Route name="EgoVehicleRoute" closed="false">
                    <Waypoint routeStrategy="fastest">
                        <Position>
                            <WorldPosition x="275" y="-173" z="1" h="0"/>
                        </Position>
                    </Waypoint>
                    <Waypoint routeStrategy="fastest">
                        <Position>
                            <WorldPosition x="250" y="-173" z="1" h="0"/>
                        </Position>
                    </Waypoint>
                </Route>
            </AssignRouteAction>
        </RoutingAction>
    </PrivateAction>
</Action>
Roosstef commented 4 years ago

Thanks for your advice.

I tried to use this example for FollowLeadingVehicle.xosc but it doesnt work for me. Can you please give an example with FollowLeadingVehicle.xosc?

fpasch commented 4 years ago

Unfortunately, that's out of our scope here. Please have a look at the official documentation (especially the "XSD 1.0 Tree View" helps to understand where to define specific xml-elements) or if you have specific questions regarding the execution within CARLA, please raise your question here