Skip to content

Commit

Permalink
fixed rate of turn
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitrispallas committed Jun 29, 2023
1 parent eb9d972 commit a618234
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ais-lib-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>dk.dma.ais.lib</groupId>
<artifactId>ais-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
</parent>


Expand Down
2 changes: 1 addition & 1 deletion ais-lib-communication/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dk.dma.ais.lib</groupId>
<artifactId>ais-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion ais-lib-json/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dk.dma.ais.lib</groupId>
<artifactId>ais-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void shouldWork() throws AisMessageException, SixbitException, SentenceEx

JSONAssert.assertEquals(
DecoderTestHelper.getJson(objectWriter,
new DecodedAisFieldObject(0, "Turning right at 0.0 degrees/ min")).toString(),
new DecodedAisFieldObject(-1, "Turning left at 0.04464028833340796 degrees/ min")).toString(),
jsonObject.get("rotDFO").toString(),
true);

Expand Down
2 changes: 1 addition & 1 deletion ais-lib-messages/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dk.dma.ais.lib</groupId>
<artifactId>ais-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,20 @@ public void setNavStatus(int navStatus) {
* @return the rot
*/
public int getRot() {
return rot;
if (rot == 128) {
return 0;
}
int signedRot = (byte) rot;
double sensorRot = Math.pow(signedRot / 4.733, 2);
if (signedRot < 0) {
sensorRot *= -1;
return (int) sensorRot + 1;
} else {
return (int) sensorRot - 1;
}
}


/**
* Gets sensor rot.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public void testMessage1() throws SentenceException, SixbitException, AisMessage
Assert.assertEquals("repeat", 0, msg.getRepeat());
Assert.assertEquals("userid", 636012431, msg.getUserId());
Assert.assertEquals("nav_status", 8, msg.getNavStatus());
Assert.assertEquals("rot", 0, msg.getRot());
Assert.assertEquals("rot", -1, msg.getRot());
Assert.assertEquals("sog", 191, msg.getSog());
Assert.assertEquals("pos_acc", 1, msg.getPosAcc());
Assert.assertEquals("longitude", -73481550, msg.getPos().getLongitude());
Expand Down
2 changes: 1 addition & 1 deletion ais-lib-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>dk.dma.ais.lib</groupId>
<artifactId>ais-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<groupId>dk.dma.ais.lib</groupId>
<artifactId>ais-parent</artifactId>
<version>2.8.1</version>
<version>2.8.2</version>
<name>AIS Parent</name>
<packaging>pom</packaging>
<description>This parent pom for AIS</description>
Expand Down

0 comments on commit a618234

Please sign in to comment.