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); }
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); }
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 }; }
private static Vector3 ToVector3(Messages.Geometry.Vector3 geometryVector3) { return(new Vector3(geometryVector3.x, geometryVector3.y, geometryVector3.z)); }
/*================*\ |* ROSToUnity *| \*================*/ public static void Vector3ToVector3(ref UnityVector3 dataOut, RosVector3 dataIn) { Ros2Unity(ref dataOut, dataIn); }
public static void Vector3ToVector3(RosVector3 dataOut, ref UnityVector3 dataIn) { Unity2Ros(dataOut, ref dataIn); }
public static void Ros2Unity(ref UnityVector3 dataOut, RosVector3 dataIn) { dataOut.x = -dataIn.y; dataOut.y = dataIn.z; dataOut.z = dataIn.x; }
public static void Unity2Ros(RosVector3 dataOut, ref UnityVector3 dataIn) { dataOut.x = dataIn.z; dataOut.y = -dataIn.x; dataOut.z = dataIn.y; }
private static Vector3 angularVelocityToVector3(Messages.Geometry.Vector3 geometryVector3) { return(new Vector3(geometryVector3.z, geometryVector3.y, -geometryVector3.x)); }
private static Vector3 linearVelocityToVector3(Messages.Geometry.Vector3 geometryVector3) { return(new Vector3(geometryVector3.x, -geometryVector3.y, geometryVector3.z)); }