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

Adds bindings for new GetState method in the state providers. #53

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

francocipollone
Copy link
Collaborator

@francocipollone francocipollone commented Feb 28, 2022

Related to maliput/maliput#458
Depends on maliput/maliput#473

Summary

As the title says, it adds bindings for the new GetState methods that are part of :

  • maliput::api::rules::DiscreteValueRuleStateProvider
  • maliput::api::rules::RangeValueRuleStateProvider

So it can be used like:

road_position = maliput.api.RoadPosition(lane, maliput.api.LanePosition(0., 0., 0.))
rule_type = maliput.api.rules.Rule.TypeId("Direction-Usage Rule Type");
state_result = road_network.discrete_value_rule_state_provider().GetState(road_position, rule_type, 1e-3)
print(state_result.state.value)
road_position = maliput.api.RoadPosition(lane, maliput.api.LanePosition(0., 0., 0.))
rule_type = maliput.api.rules.Rule.TypeId("Speed-Limit Rule Type");
state_result = road_network.range_value_rule_state_provider().GetState(road_position, rule_type, 1e-3)
print(state_result.state.max)

Copy link
Collaborator

@agalbachicar agalbachicar left a comment

Choose a reason for hiding this comment

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

LGTM

@francocipollone francocipollone merged commit 15f35f0 into main Mar 1, 2022
@francocipollone francocipollone deleted the francocipollone/add_get_state_method branch March 1, 2022 12:43
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.

2 participants