-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve "Add test play for stopping ball"
Closes #1981 See merge request main/Sumatra!1867 sumatra-commit: 2cb92f480bec69c7f99579704906037b671e38f3
- Loading branch information
1 parent
33c849f
commit 5da84e3
Showing
4 changed files
with
116 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
modules/common-math/src/main/java/edu/tigers/sumatra/math/pose/PoseConverter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2009 - 2020, DHBW Mannheim - TIGERs Mannheim | ||
*/ | ||
|
||
package edu.tigers.sumatra.math.pose; | ||
|
||
import com.github.g3force.s2vconverter.IString2ValueConverter; | ||
import edu.tigers.sumatra.math.vector.Vector3; | ||
import lombok.extern.log4j.Log4j2; | ||
|
||
|
||
@Log4j2 | ||
public class PoseConverter implements IString2ValueConverter | ||
{ | ||
@Override | ||
public boolean supportedClass(final Class<?> impl) | ||
{ | ||
return impl.equals(Pose.class); | ||
} | ||
|
||
|
||
@Override | ||
public Object parseString(final Class<?> impl, final String value) | ||
{ | ||
if (impl.equals(Pose.class)) | ||
{ | ||
return Pose.valueOf(value); | ||
} | ||
return null; | ||
} | ||
|
||
|
||
@Override | ||
public String toString(final Class<?> impl, final Object value) | ||
{ | ||
Pose pose = (Pose) value; | ||
return Vector3.from2d(pose.getPos(), pose.getOrientation()).getSaveableString(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters