usdot-fhwa-OPS / V2X-Hub

V2X Hub is a message handler that acts as a translator and data aggregator/disseminator for infrastructure components of a connected vehicle deployment.
Apache License 2.0
123 stars 69 forks source link

Update TIM Plugin to accept standard XML format #508

Closed dan-du-car closed 1 year ago

dan-du-car commented 1 year ago

PR Details

Description

Currently, the TIM plugin only encodes Curve Speed Warning information in a non-standard XML into a TIM message. I would like to have all ITIS codes and text inputs accepted in a standard XML format and encoded into a TIM message. The below XML is a sample standard XML accepted by the TIM plugin

<TravelerInformation>
      <msgCnt>1</msgCnt>
      <timeStamp>115549</timeStamp>
      <packetID>000000000023667BAC</packetID>
      <dataFrames>
        <TravelerDataFrame>
          <sspTimRights>0</sspTimRights>
          <frameType>
            <advisory/>
          </frameType>
          <msgId>
            <roadSignID>
              <position>
                <lat>389549775</lat>
                <long>-771491835</long>
                <elevation>390</elevation>
              </position>
              <viewAngle>1111111111111111</viewAngle>
              <mutcdCode>
                <warning/>
              </mutcdCode>
            </roadSignID>
          </msgId>
          <startTime>115549</startTime>
          <duratonTime>1</duratonTime>
          <priority>7</priority>
          <sspLocationRights>0</sspLocationRights>
          <regions>
            <GeographicalPath>
              <anchor>
                <lat>389549775</lat>
                <long>-771491835</long>
                <elevation>390</elevation>
              </anchor>
              <directionality>
                <both/>
              </directionality>
              <closedPath>
                <true/>
              </closedPath>
              <description>
                <geometry>
                  <direction>1111111111111111</direction>
                  <circle>
                    <center>
                      <lat>389549775</lat>
                      <long>-771491835</long>
                      <elevation>390</elevation>
                    </center>
                    <radius>74</radius>
                    <units>
                      <meter/>
                    </units>
                  </circle>
                </geometry>
              </description>
            </GeographicalPath>
          </regions>
          <sspMsgRights1>0</sspMsgRights1>
          <sspMsgRights2>0</sspMsgRights2>
          <content>
            <advisory>
              <SEQUENCE>
                <item>
                  <itis>7186</itis>
                </item>
              </SEQUENCE>
              <SEQUENCE>
                <item>
                  <itis>9476</itis>
                </item>
              </SEQUENCE>
              <SEQUENCE>
                <item>
                  <itis>13569</itis>
                </item>
              </SEQUENCE>
            </advisory>
          </content>
          <url>987654321</url>
        </TravelerDataFrame>
      </dataFrames>
    </TravelerInformation>

Related Issue

https://github.com/usdot-fhwa-OPS/V2X-Hub/issues/502

Motivation and Context

How Has This Been Tested?

Types of changes

Checklist:

vibhubithar commented 1 year ago

Hi thanks for looking into this, i am using https://webapp.connectedvcs.com/tim/# to generate the TIM, which generates an ANS.1 encoded message based on this XML

<MessageFrame>
  <messageId>31</messageId>
  <value>
    <TravelerInformation>
      <msgCnt>1</msgCnt>
      <packetID>000000000032320993</packetID>
      <dataFrames>
        <TravelerDataFrame>
          <sspTimRights>0</sspTimRights>
          <frameType>
            <advisory/>
          </frameType>
          <msgId>
            <roadSignID>
              <position>
                <lat>488894612</lat>
                <long>-1002960644</long>
              </position>
              <viewAngle>0000000000000000</viewAngle>
              <mutcdCode>
                <warning/>
              </mutcdCode>
            </roadSignID>
          </msgId>
          <startYear>2023</startYear>
          <startTime>136656</startTime>
          <duratonTime>32000</duratonTime>
          <priority>5</priority>
          <sspLocationRights>0</sspLocationRights>
          <regions>
            <GeographicalPath>
              <anchor>
                <lat>378894612</lat>
                <long>-1222960644</long>
              </anchor>
              <laneWidth>366</laneWidth>
              <closedPath>
                <true/>
              </closedPath>
              <direction>0000000000000000</direction>
              <description>
                <path>
                  <offset>
                    <xy>
                      <nodes>
                        <NodeXY>
                          <delta>
                            <node-XY5>
                              <x>88</x>
                              <y>2314</y>
                            </node-XY5>
                          </delta>
                        </NodeXY>
                        <NodeXY>
                          <delta>
                            <node-XY5>
                              <x>843</x>
                              <y>153</y>
                            </node-XY5>
                          </delta>
                        </NodeXY>
                        <NodeXY>
                          <delta>
                            <node-XY5>
                              <x>1097</x>
                              <y>-4106</y>
                            </node-XY5>
                          </delta>
                        </NodeXY>
                        <NodeXY>
                          <delta>
                            <node-XY5>
                              <x>-790</x>
                              <y>-235</y>
                            </node-XY5>
                          </delta>
                        </NodeXY>
                        <NodeXY>
                          <delta>
                            <node-XY5>
                              <x>-1150</x>
                              <y>4194</y>
                            </node-XY5>
                          </delta>
                        </NodeXY>
                      </nodes>
                    </xy>
                  </offset>
                </path>
              </description>
            </GeographicalPath>
          </regions>
          <sspMsgRights1>0</sspMsgRights1>
          <sspMsgRights2>0</sspMsgRights2>
          <content>
            <advisory>
              <SEQUENCE>
                <item>
                  <itis>7186</itis>
                </item>
              </SEQUENCE>
              <SEQUENCE>
                <item>
                  <itis>9476</itis>
                </item>
              </SEQUENCE>
              <SEQUENCE>
                <item>
                  <itis>13569</itis>
                </item>
              </SEQUENCE>
            </advisory>
          </content>
        </TravelerDataFrame>
      </dataFrames>
    </TravelerInformation>
  </value>
</MessageFrame>
paulbourelly999 commented 1 year ago

looking into this, i am using https://webapp.connectedvcs.com/tim/# to generate the TIM, which generates an ANS.1 encoded message based on this XML

I think in the tool you posted, you have a drop down near the bottom that allows you to generate the TIM message in multiple formats. The format you have posted I think includes the message frame. I believe if you select the message type "TIM" it will provide the XML posted in this PR that does not include the message frame. Other than that I believe the payloads are identical. Below I have a screen shot of the message type drown down menu which I believe controls this. @jwilliammartin or @dan-du-car have you used the TIM web tool and can you confirm this behavior? image

jwillmartin commented 1 year ago

@paulbourelly999 I tested a couple different versions of TIM messages with Vibhu. They included and excluded different optional fields from the standard. I also used messages created by the the ISD Creator Tool. All worked well.