23 lines
496 B
Python
23 lines
496 B
Python
from pydantic import BaseModel
|
|
from rail_proto.lib import MotionInfo,Vector
|
|
|
|
class Motion(BaseModel):
|
|
x: float
|
|
y: float
|
|
z: float
|
|
rotY: float
|
|
|
|
def ToProto(self) -> MotionInfo:
|
|
return MotionInfo(
|
|
pos=Vector(
|
|
x=int(self.x*1000),
|
|
y=int(self.y*1000),
|
|
z=int(self.z*1000)
|
|
),
|
|
rot=Vector(
|
|
x=0,
|
|
y=int(self.rotY*1000),
|
|
z=0
|
|
)
|
|
)
|