OpenSimulationInterface / open-simulation-interface

A generic interface for the environmental perception of automated driving functions in virtual scenarios.
Other
265 stars 124 forks source link

How is speed limit in LogicalLane related to <speed> tag in OpenDRIVE? #823

Open xuanyuxin opened 4 weeks ago

xuanyuxin commented 4 weeks ago

I tried to define speed limit both for lane and road in an OpenDRIVE file:

<road name="cubic_road" length="1.4644343507055999e+03" id="0" junction="-1">
        <link>
        </link>
        <speed max="80.0" unit="km/h"/>
...
<lane id="-7" type="border" level= "false">
                        <speed sOffset="0.0" max="80.0" unit="km/h"/>
...

However, I am not able to get the speed limit properly in OSI trace, i.e. the following Python code prints nothing:

self.msg = GroundTruth()
...
for m in self.msg.logical_lane:
    print('      lane speed limit:', m.traffic_rule.speed_limit.speed_limit_value.value)
for m in self.msg.road_marking:
    print('      road speed limit:', m.road_marking.value.value)

I see in the proto file (osi_logicallane.proto and osi_trafficsign.proto), the speed_limit_value and its value is optional, am I accessing it correct or is there another way to examine whether the speed limit actually exists or not?

message SpeedLimit {
    optional TrafficSignValue speed_limit_value = 1;
}
...
message TrafficSignValue
{
    optional double value = 1;
}

Thank you very much!