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

Consider vehicle weight and length in autocost like in truckcost #4370

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

Conversation

FScholPer
Copy link

Issue

Tasklist

  • Add tests
  • Add #fixes with the issue number that this PR addresses
  • Update the docs with any new request parameters or changes to behavior described
  • Update the changelog
  • If you made changes to the lua files, update the taginfo too.

Requirements / Relations

Frank Scholter Peres on behalf of Mercedes-Benz Tech Innovation GmbH.
Provider Information

@FScholPer FScholPer changed the title Consider vehicle weight and length in autocost Consider vehicle weight and length in autocost like in truckcost Oct 30, 2023
Copy link
Member

@nilsnolde nilsnolde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine for me. Just a few nits.

@@ -729,15 +729,15 @@ struct graph_callback : public OSMPBF::Callback {
OSMAccessRestriction restriction;
restriction.set_type(AccessType::kMaxLength);
restriction.set_value(std::stof(tag_.second) * 100);
restriction.set_modes(kTruckAccess);
restriction.set_modes(kTruckAccess | kAutoAccess);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plus all other modes, see above


using namespace valhalla;

class CarRestrictionTest : public ::testing::TestWithParam<std::pair<std::string, std::string>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you put that with gurka/test_truck_restrictions and maybe rename that? recently we're trying not to create any more tests unless it's really warranted.

@@ -71,6 +71,8 @@ constexpr float kMaxFactor = 100000.0f;
const std::string kDefaultAutoType = "car";
constexpr float kDefaultAutoHeight = 1.6f; // Meters (62.9921 inches)
constexpr float kDefaultAutoWidth = 1.9f; // Meters (74.8031 inches)
constexpr float kDefaultAutoLength = 4.0f; // Meters (157,4808 inches)
constexpr float kDefaultAutoWeight = 2.4f; // / Metric Tons (48,000 lbs)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a huge SUV as default haha

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUV, not really. length-wise this is a shorter than normal car. a typical sedan is something like 4.5 to 5m long. weight-wise i would agree this is on the heavier side but if you go with an average sedan weight of somethign like 3500lbs and add 1000lbs of people sitting in it and another 300lbs of crap in the trunk etc you are much closer to 2.4mtons (2.2 mtons).

be careful with the use of german decimal formatting above in the comments, it can really confuse non-german speakers/readers

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I mean the weight, not the length. And you're right, they don't fit very well.

@nilsnolde
Copy link
Member

also you'll need to run scripts/format.sh.

@Trietes
Copy link
Contributor

Trietes commented Mar 12, 2024

Any update on this? Would be nice to have and its mostly done already

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.

Vehicle length and weight not considered in autocost
5 participants