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

Implement a Multi-Lane Demo Using Hard-Coded Dragway #4990

Closed
liangfok opened this issue Jan 31, 2017 · 14 comments
Closed

Implement a Multi-Lane Demo Using Hard-Coded Dragway #4990

liangfok opened this issue Jan 31, 2017 · 14 comments
Assignees
Labels
priority: medium type: feature request unused team: automotive This team is no longer active within this repository.

Comments

@liangfok
Copy link
Contributor

liangfok commented Jan 31, 2017

This will build upon #4989 . Perhaps using the "MOBIL" lane-change decision model.

This will also need a lane change planner. The planner could be as simple as specifying the time by which the car must be in the new lane.

@liangfok liangfok added unused team: automotive This team is no longer active within this repository. type: feature request labels Jan 31, 2017
@liangfok liangfok self-assigned this Jan 31, 2017
@liangfok liangfok changed the title Implement a Lane Change Demo Using Hard-Coded Drag Way Implement a Lane Change Demo Using Hard-Coded Dragway Jan 31, 2017
@jwnimmer-tri
Copy link
Collaborator

Possibly the MOBIL lane-change model is a good candidate, to complement the IDM car model.

@jwnimmer-tri
Copy link
Collaborator

... and for an earlier spiral of this, even multi-lane bonehead cars + SimpleCar ego car under key/joy control driving on the #4989 would be a big help. (In other words, we don't need agent planners in the first spiral.)

@jwnimmer-tri
Copy link
Collaborator

Let's keep this issue about just the first spiral -- having a demo up and running, with either bonehead or IDM cars. The SimpleCar can drive around and lane-change, but the agents don't have to.

I've filed #5113 about MOBIL as a possible second step.

@jwnimmer-tri jwnimmer-tri changed the title Implement a Lane Change Demo Using Hard-Coded Dragway Implement a Multi-Lane Demo Using Hard-Coded Dragway Feb 9, 2017
@liangfok
Copy link
Contributor Author

liangfok commented Feb 13, 2017

Now that #5038 is merged, I plan on starting work on this. My plan is to either use or mimic an EndlessRoadCar.

@liangfok
Copy link
Contributor Author

liangfok commented Feb 13, 2017

Since #5032, which contains EndlessRoadCar, has not been merged into master and I'm unable to compile the branch (see below), I'm now looking to see whether I can simply plop a SimpleCar on top of a Dragway.

Here is the compile-time error I'm seeing when compiling @maddog-tri's "maliput-demo-carbits" branch, SHA e835de3:

[289/652] Building CXX object automotive/CMakeFiles/drakeAutomotive.dir/maliput/monolane/lane.cc.o
FAILED: /usr/bin/g++-4.9   -DEIGEN_MPL2_ONLY -DHAVE_SPDLOG -DdrakeAutomotive_EXPORTS -I/home/liang/dev/drake-distro-2/drake/.. -I/home/liang/dev/drake-distro-2/drake/pod-build/lcmgen -isystem /home/liang/dev/drake-distro-2/build/install/include/eigen3 -isystem /home/liang/dev/drake-distro-2/build/install/include -Werror=all -Werror=ignored-qualifiers -Werror=overloaded-virtual -Werror=extra -Werror=return-local-addr -Wno-unused-parameter -Wno-missing-field-initializers -g -fPIC   -std=gnu++14 -MMD -MT automotive/CMakeFiles/drakeAutomotive.dir/dev/endless_road_oracle.cc.o -MF automotive/CMakeFiles/drakeAutomotive.dir/dev/endless_road_oracle.cc.o.d -o automotive/CMakeFiles/drakeAutomotive.dir/dev/endless_road_oracle.cc.o -c /home/liang/dev/drake-distro-2/drake/automotive/dev/endless_road_oracle.cc
/home/liang/dev/drake-distro-2/drake/automotive/dev/endless_road_oracle.cc: In function ‘void drake::automotive::internal::IndexJunctions(const std::vector<drake::automotive::internal::SourceState>&, const std::vector<std::vector<drake::automotive::internal::PathRecord> >&, std::map<const drake::maliput::api::Junction*, std::vector<drake::automotive::internal::TimeBox> >*, std::map<int, std::vector<const drake::maliput::api::Junction*> >*)’:
/home/liang/dev/drake-distro-2/drake/automotive/dev/endless_road_oracle.cc:474:51: error: no matching function for call to ‘drake::automotive::internal::TimeBox::TimeBox(<brace-enclosed initializer list>)’
                                        s_in, s_out};
                                                   ^
/home/liang/dev/drake-distro-2/drake/automotive/dev/endless_road_oracle.cc:474:51: note: candidates are:
In file included from /home/liang/dev/drake-distro-2/drake/automotive/dev/endless_road_oracle.cc:2:0:
/home/liang/dev/drake-distro-2/drake/../drake/automotive/dev/endless_road_oracle-internal.h:62:8: note: drake::automotive::internal::TimeBox::TimeBox()
 struct TimeBox {
        ^
/home/liang/dev/drake-distro-2/drake/../drake/automotive/dev/endless_road_oracle-internal.h:62:8: note:   candidate expects 0 arguments, 6 provided
/home/liang/dev/drake-distro-2/drake/../drake/automotive/dev/endless_road_oracle-internal.h:62:8: note: constexpr drake::automotive::internal::TimeBox::TimeBox(const drake::automotive::internal::TimeBox&)
/home/liang/dev/drake-distro-2/drake/../drake/automotive/dev/endless_road_oracle-internal.h:62:8: note:   candidate expects 1 argument, 6 provided
/home/liang/dev/drake-distro-2/drake/../drake/automotive/dev/endless_road_oracle-internal.h:62:8: note: constexpr drake::automotive::internal::TimeBox::TimeBox(drake::automotive::internal::TimeBox&&)
/home/liang/dev/drake-distro-2/drake/../drake/automotive/dev/endless_road_oracle-internal.h:62:8: note:   candidate expects 1 argument, 6 provided

@jwnimmer-tri
Copy link
Collaborator

@liangfok Are you able to make progress?

I think EndlessRoadCoar gloms together too many concerns at once. I bet you could steal just the bonehead variant of it and get really far (+ SimpleCar) on a dragway. Or also the TrajectoryCar should be able to drive the dragway okay also (just create a single-segment path to feed it, that is manually lined up with the dragway lanes).

@liangfok
Copy link
Contributor Author

Are you able to make progress?

I'm still studying the code; not sure yet whether I'm blocked. One concern I have is there's nothing in master that demonstrates how a maliput::api::RoadGeometry is transformed into a "world" in which any vehicle model runs. Maybe I just missed it?

I think EndlessRoadCar gloms together too many concerns at once. I bet you could steal just the bonehead variant of it and get really far (+ SimpleCar) on a dragway.

I looked through #5032 and wasn't able to identify where the bonehead variant of it is defined. Can you provide a pointer?

Or also the TrajectoryCar should be able to drive the dragway okay also (just create a single-segment path to feed it, that is manually lined up with the dragway lanes).

Do you mean take maliput::api::RoadGeometry and convert it into a automotive::Curve2, which is needed by TrajectoryCar's constructor?

Thanks for any help!

@jwnimmer-tri
Copy link
Collaborator

One concern I have is there's nothing in master that demonstrates how a maliput::api::RoadGeometry is transformed into a "world" in which any vehicle model runs.

For viz you can add a flat plane manually if you want. But otherwise, none of the Systems we're talking about needs RBT or a world at all.

I looked through #5032 and wasn't able to identify where the bonehead variant of it is defined. Can you provide a pointer?

The kNone control type.

Do you mean take maliput::api::RoadGeometry and convert it into a automotive::Curve2, which is needed by TrajectoryCar's constructor?

Nope. It's a dragway. The bonehead cars can drive straight. It should be very easy to make a Curve2 with a single segment that aligns with the lane center (presumably we can just ask Maliput for the lane start and end in Geo (cartesian) space and then feed those into the Curve2 constructor.

@liangfok
Copy link
Contributor Author

Alright, my plan is to create an executable that:

  1. Instantiates a drake::maliput::dragway::RoadGeometry.
  2. Automatically converts the RoadGeometry into a Curve2 that spans the entire driveable area of the dragway.
  3. Instantiates a TrajectoryCar using Curve2 for each lane that simply drives down the length of the dragway.
  4. Loads the TrajectoryCar instances into an AutomotiveSimulator.
  5. Runs the simulator.

Does the above sound right?

@jwnimmer-tri
Copy link
Collaborator

That's okay to start. We'll also want a SimpleCar (keyboard control) in there as well at some point.

Can it just be another mode of automotive_demo, instead of a separate program?

@liangfok
Copy link
Contributor Author

Can it just be another mode of automotive_demo, instead of a separate program?

Sure. I will try to make it so.

@jwnimmer-tri
Copy link
Collaborator

I'm unable to compile the branch (see below) ...

(Jumping back a bit.) For the record, CI agrees with you that the PR doesn't compile.

@maddog-tri
Copy link

W.r.t. the PR not compiling, meh, works fine on xenial. (And, it is fixed for you and CI now, too. FWIW, it did compile in CI until, in response to review comments, I added {} default initializers to the fields of TimeBox which apparently caused it to become non-aggregate in the eyes of the older gcc, etc, etc, and I did not notice the subsequent CI failure, because why would I... I'm busy looking at reviewable.io, not github.)

Also, I have a maliput-demo-autobits branch which bears the subsequent changes to automotive-demo and friends to run the demo. (Does it work in CI? Beats me.)

@liangfok
Copy link
Contributor Author

@maddog-tri, thanks for fixing the bug. I will look into maliput-demo-autobits. Regarding the CI failure, are you saying it didn't show up in Reviewable.io's donut-shaped icon at the top (see screenshot below)?

screenshot from 2017-02-14 10 08 49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium type: feature request unused team: automotive This team is no longer active within this repository.
Projects
None yet
Development

No branches or pull requests

3 participants