コード例 #1
0
 private static Messages.Geometry.Vector3 GetGeometryVector3(Vector3 vector3)
 {
     Messages.Geometry.Vector3 geometryVector3 = new Messages.Geometry.Vector3();
     geometryVector3.x = vector3.x;
     geometryVector3.y = vector3.y;
     geometryVector3.z = vector3.z;
     return(geometryVector3);
 }
コード例 #2
0
 private Messages.Geometry.Vector3 GetGeometryVector3(Vector3 position)
 {
     Messages.Geometry.Vector3 geometryVector3 = new Messages.Geometry.Vector3();
     geometryVector3.x = position.x;
     geometryVector3.y = position.y;
     geometryVector3.z = position.z;
     return(geometryVector3);
 }
コード例 #3
0
    void Start()
    {
        joystickCanvas.enabled = false;
        cmdPublisher           = new RosSharp.RosBridgeClient.NonMono.Publisher <Twist>(ref rosConnector, "/cmd_vel");

        forwardLinear = new RosSharp.RosBridgeClient.Messages.Geometry.Vector3 {
            x = 0.4f, y = 0.0f, z = 0.0f
        };
        backwardLinear = new RosSharp.RosBridgeClient.Messages.Geometry.Vector3 {
            x = -0.4f, y = 0.0f, z = 0.0f
        };
        stopLinear = new RosSharp.RosBridgeClient.Messages.Geometry.Vector3 {
            x = 0.0f, y = 0.0f, z = 0.0f
        };
        counterClockwiseAngular = new RosSharp.RosBridgeClient.Messages.Geometry.Vector3 {
            x = 0.0f, y = 0.0f, z = 0.5f
        };
        clockwiseAngular = new RosSharp.RosBridgeClient.Messages.Geometry.Vector3 {
            x = 0.0f, y = 0.0f, z = -0.5f
        };
        stopAngular = new RosSharp.RosBridgeClient.Messages.Geometry.Vector3 {
            x = 0.0f, y = 0.0f, z = 0.0f
        };
    }
コード例 #4
0
 private static Vector3 ToVector3(Messages.Geometry.Vector3 geometryVector3)
 {
     return(new Vector3(geometryVector3.x, geometryVector3.y, geometryVector3.z));
 }
コード例 #5
0
    /*================*\
    |*   ROSToUnity   *|
    \*================*/

    public static void Vector3ToVector3(ref UnityVector3 dataOut, RosVector3 dataIn)
    {
        Ros2Unity(ref dataOut, dataIn);
    }
コード例 #6
0
 public static void Vector3ToVector3(RosVector3 dataOut, ref UnityVector3 dataIn)
 {
     Unity2Ros(dataOut, ref dataIn);
 }
コード例 #7
0
 public static void Ros2Unity(ref UnityVector3 dataOut, RosVector3 dataIn)
 {
     dataOut.x = -dataIn.y;
     dataOut.y = dataIn.z;
     dataOut.z = dataIn.x;
 }
コード例 #8
0
 public static void Unity2Ros(RosVector3 dataOut, ref UnityVector3 dataIn)
 {
     dataOut.x = dataIn.z;
     dataOut.y = -dataIn.x;
     dataOut.z = dataIn.y;
 }
コード例 #9
0
 private static Vector3 angularVelocityToVector3(Messages.Geometry.Vector3 geometryVector3)
 {
     return(new Vector3(geometryVector3.z, geometryVector3.y, -geometryVector3.x));
 }
コード例 #10
0
 private static Vector3 linearVelocityToVector3(Messages.Geometry.Vector3 geometryVector3)
 {
     return(new Vector3(geometryVector3.x, -geometryVector3.y, geometryVector3.z));
 }