Giter Site home page Giter Site logo

bark-simulator / bark Goto Github PK

View Code? Open in Web Editor NEW
287.0 17.0 68.0 13.66 MB

Open-Source Framework for Development, Simulation and Benchmarking of Behavior Planning Algorithms for Autonomous Driving

Home Page: https://bark-simulator.github.io/

License: MIT License

Python 30.82% Shell 0.07% C++ 64.12% Dockerfile 0.16% Starlark 4.83%
benchmark autonomous-driving research multi-agent self-driving-car bark-simulator bark simulation machine-learning robotics

bark's People

Contributors

acarcelik avatar akreutz avatar bastianhofmann avatar cesarliu avatar cirrostratus1 avatar codacy-badger avatar daniel-bencic avatar dependabot[bot] avatar juloberno avatar klemense1 avatar mansoorcheema avatar patrickhart avatar thrashabaddon avatar tin1254 avatar tobiaskessler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bark's Issues

FindNearestLanes doesn't return the correct lanes

I commented out the part from xodr_parser where all the lanes other than of "driving" type are ignored, so the rtree in MapInterface should have all lanes.

Then I queried the 3 nearest lanes from a given point using (the python binding) of FindNearestLanes.

For this point I would expect the 3 nearest lanes to be of type sidewalk (5), border (6) and driving (1):
point_sw

But the function returns two lanes of type 1 and one of type 6:
Screenshot from 2019-07-17 09-09-22

When trying it for a different point:
point_outside
Here the function works. It returns (as expected) lanes of type none (0), border (6) and sidewalk (5).

I also tried it with random other points along the road, for some points it gives the expected results, for others not.

I circumvented this problem by creating my own function to find the nearest lanes which uses:
boost::geometry::index::satisfies([&](rtree_lane_value const& v) {return distance(v.second->get_line(), point) <= radius; }),

instead of boost::geometry::index::nearest(point, num_lanes);.
This returns the expected results (but requires a radius parameter).

I also created a function to find all the lanes that are intersected by a given line and when doing the rtree query using boost::geometry::index::intersects(line_segment), it didn't return anything when it clearly should. Using a own lambda (here using modules::geometry Collide) solved this problem too.

High time step version of IDM

The classic IDM only works as desired when a low time step is used. The acceleration is not updated during this phase leading to unsatisfying behavior with larger time steps

Deprecate some XODR Maps

CulDeSac (center line is really shaky)
Crossing8Course (it causes problems, that there is a loop in the map)

Function `modules::world::objects::Agent::set_goal_definition` does not update the goal definition of the Agent's local_map

The function modules::world::objects::Agent::set_goal_definition should make it possible to change the GoalDefinition of an Agent after its creation. In its implementation

void set_goal_definition(const GoalDefinition &goal_definition) {
goal_definition_ = goal_definition;
GenerateLocalMap();
// TODO(@hart): parameter
UpdateDrivingCorridor(20.0);
}

the function only changes the GoalDefinition of the Agent, but not the GoalDefinition of the Agent's LocalMap.
The subsequent call to
void Agent::GenerateLocalMap() {
State agent_state = get_current_state();
Point2d agent_xy(agent_state(StateDefinition::X_POSITION),
agent_state(StateDefinition::Y_POSITION));
if (!local_map_->Generate(agent_xy)) {
std::cout << "LocalMap generation for agent "
<< get_agent_id() << " failed." << std::endl;
}
}

therefore causes
bool LocalMap::Generate(Point2d point, double horizon) {
if(map_interface_ == nullptr) {
return false;
}
goal_lane_id_ = GoalLaneIdFromGoalDefinition(goal_definition_);

to generate the new LocalMap using the old GoalDefinition.
The straightforward solution would be to add a function modules::world::map::LocalMap::set_goal_definition and to call it in modules::world::objects::Agent::set_goal_definition, which I tried in my fork of the repo. This approach works for what I want to do, however it causes the test //examples:scenario_generation_dump to fail. This makes me wonder if I understood the intended use of set_goal_definition correctly.
@klemense1

A lane and its successor lane are sometimes not connected

When working with the file 4way_intersection.xodr I noticed that in some cases there are gaps between a lane and the next succeeding lane. This can be seen here:
successor_lanes
According to the roadgraph, lines of the same color are in a predecessor/successor relationship. For the (global) LaneIds 35->3, 37->10, 46->29 and 47->50 there is a gap between the corresponding lines.
A test case for this error is implemented in #52
@klemense1

CI BROKEN

After disabling and enabling access for CircleCI. Cannot pull BARK anymore.

Move to faster CI alltogether?

Scenario Generation

The scenario generation seems to call the map generation in every single call. Since a scenario for now only contains a single map, this could be sped up by loading the map only once.

Required for bark-ml.

Concept ExecutionModel

  • Specify reuirements of execution model trajectory exactly, e.g. must contain a trajectory state at specific world time
  • Remove additional nearest time point search in agent DoExecution()
  • ExecutionModelNan

assert times!

Problem with Polygon2d

The polygon has to be post translated and cannot be initialized with a correct center point. At least it is being plotted wrong.

      goal_polygon = Polygon2d([0, 0, 0],
                               np.array(agent_json["goal"]["polygon_points"]))
      goal_polygon = goal_polygon.translate(Point2d(agent_json["goal"]["center_pose"][0],
                                                    agent_json["goal"]["center_pose"][1]))

print()s or cout << s to glog warnings/errors

The examples always show stuff like
'''
Roadlink has no successor.
Roadlink has no predeseccor.
'''
which is annoying but not an error.

TODO check the code for python print()s or std::cout << s and replace them by glog calls

Bug: Incorrect creation of neighbor edges for lanes with negativ lane position

The current implementation of neighbor edge creation drops the sign of neighbor's lane position. This is incorrect for Lanes with a LanePosition < 0:

inner_lane_pos = abs(lane.lane_position) - 1
inner_lane_id = self.get_lane_id_by_pos(lane_section, inner_lane_pos)

Example:
For lane.lane_position = -2, inner_lane_pos should be -1, but is:
inner_lane_pos = abs(lane.lane_position) - 1 = abs(-2) - 1 = 1

@klemense1

SateDefinition is not model specific

Due to the definition of SateDefinition enum in the DynamicModel class not enough flexibility is provided.

Create a State class for each derived model that contains a SateDefinition.

RemoveOutOfMapAgents

Make this optional or enforce bounding_box in scenarios.
For now commented out..

Bazel test failed with TIMEOUT for python examples on macOS

Some test cases from running bazel test //... are failed with TIMEOUT on macOS, it seems to be a problem with Python (virtual environment was activated). I've also tried to use --test_timeout on each failed test case but it seems to take forever. Below are the details and the attachments: saved output from terminal and testlogs.

OS: macOS Mojave 10.14.5
Bazel version: Build label: 0.15.0
Python version: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:39:00)
GCC: 4.2.1 (Apple Inc. build 5666) (dot 3) on darwin
Virtualenv version: 16.5.0

Bark Terminal Saved Output.txt

Output from 'bazel test ::examples-od8_const_vel_one_agent'.txt

bazel-testlogs.zip

Output from 'bazel run ::examples-od8_const_vel_one_agent'.txt

Python Output.txt

Bazel Error with Submodule MCTS Planner

see https://circleci.com/gh/bark-simulator/bark/240

ERROR: /home/esterle/.cache/bazel/_bazel_esterle/686875265778f8801c25fece24de0587/external/planner_uct/src/BUILD:1:1: no such package '@bark_project//modules': BUILD file not found in directory 'modules' of external repository @bark_project and referenced by '@planner_uct//src:planner_uct_single_agent' ERROR: Analysis of target '//modules/models/behavior/plan:uct_single_agent' failed; build aborted: no such package '@bark_project//modules': BUILD file not found in directory 'modules' of external repository @bark_project INFO: Elapsed time: 0.296s INFO: 0 processes. FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured) Fetching @com_github_eigen_eigen; fetching Fetching @gtest; fetching Fetching @boost; fetching

The xodr_parser raises a ValueError during lane mark parsing for Road Mark Type `none`

Lanes can have the Road Mark Type none, as in 4way_intersection.xodr:27. These roadMark-tags do not have a width property, and therefore this code section fails (in particular line 335):

if "road_mark" in lane:
rm = RoadMark()
rm.type = lane['road_mark']['type']
rm.color = lane['road_mark']['color']
rm.width = float(lane['road_mark']['width'])
new_lane.road_mark = rm

A solution would be to exclude road marks of type RoadMarkType.none from parsing, or parse them differently.

@klemense1

Only support for one lanesection per road for OpenDrive

in void Roadgraph::GeneratePreAndSuccessors(OpenDriveMapPtr map), predesssor and successor lane section are currently always assumed to be in the predecessing and successing road element. Thus, we currently only support one lanesection per road element. But OpenDrive also allows to define more than one lane section per road element.

Missing PyGame GUI when running python examples

running examples with commands like bazel run //examples:od8_const_vel_one_agent and bazel run //examples:od8_const_vel_two_agent encouters a missing GUI problem (only blank PyGame windows are shown), all tests are passed. Below are the details of the system:

OS: macOS Mojave 10.14.5
Bazel version: Build label: 0.15.0
Python 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 16:39:00)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Virtualenv version: 16.5.0

nicer visualization of vehicles in matplotlib viewer

integrate drawing of svg vehicle shape into matplotlib viewer:

  • replace each agents polygon with appropriately scaled vehicle svg
  • maybe have the collision shape additionally drawn with certain transparency below

Bug: Lanes are sometimes not created with the correct length

When a Lane is created using the function modules::world::create_lane_with_offset_from_line in commons.hpp, the created line sometimes is too short by one point.

The bug happens when the requested length of the new Lane, as determined by the parameters lane_width_current_lane.s_start and lane_width_current_lane.s_end, is not equal to 1.
This is almost always the case when a map is created using xodr_parser.py.

Check Bazel Capabilities for Memory Checks

Can we run weekly or nightly builds with valgrind? I think bazel supports this with the --run_under option

'--run_under= default: see description
Prefix to insert in front of command before running. Examples: --run_under=valgrind --run_under=strace --run_under='strace -c' --run_under='valgrind --quiet --num-callers=20' --run_under=//package:target --run_under='//package:target --options'
Tags: action_command_lines'

(https://docs.bazel.build/versions/master/command-line-reference.html)

Memory leak when building cpp using optimization (O3)

When the -O3 flag is set in the .bazelrc, a memory leak occures in several tests.

.bazelrc

test --test_output=errors --action_env="GTEST_COLOR=1"

# Force bazel output to use colors (good for jenkins) and print useful errors.
common --color=yes

build --cxxopt='-std=c++14'

Time is not reset in scenario

The world time is not reset after runtime.reset() is called.

Mismatch: 80%
Max absolute difference: 2.
Max relative difference: 1.
 x: array([0.000000e+00, 5.111000e+03, 5.106831e+03, 1.570000e+00,
       1.000000e+01], dtype=float32)
 y: array([1.800000e-01, 5.110883e+03, 5.108831e+03, 1.570796e+00,
       1.000000e+01], dtype=float32)

syntax error in WORKSPACE file

when calling bazel run command, the following ERROR messages are given

ERROR: /path/to/WORKSPACE:22:1: syntax error at '<': expected expression
ERROR: /path/to/WORKSPACE:29:1: non-keyword arg after keyword arg
ERROR: error loading package 'external': Failed to parse WORKSPACE file
ERROR: error loading package 'external': Failed to parse WORKSPACE file
INFO: Elapsed time: 0.093s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
FAILED: Build did NOT complete successfully (0 packages loaded)

IDM s out of bound exception

All vehicles IDM at highway straight map yields out of bound exception when some vehicles are at the end of their driving horizon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.