예제 #1
0
    public static Frame ToUnityFrame(this ROSFrame src)
    {
        Frame dest = new Frame();

        dest.accX            = src.accX;
        dest.accY            = src.accY;
        dest.accZ            = src.accZ;
        dest.angle_increment = src.angle_increment;
        dest.angle_min       = src.angle_min;
        dest.angle_max       = src.angle_max;
        dest.frameid         = src.frameid;
        dest.gyrX            = src.gyrX;
        dest.gyrY            = src.gyrY;
        dest.gyrZ            = src.gyrZ;
        dest.img             = src.img;
        dest.imgfmt          = src.imgfmt;
        dest.intensities     = src.intensities;
        dest.posX            = src.posX;
        dest.posY            = src.posY;
        dest.posZ            = src.posZ;
        dest.rotX            = src.rotX;
        dest.rotY            = src.rotY;
        dest.rotZ            = src.rotZ;
        dest.seq             = src.seq;
        dest.ranges          = src.ranges;
        dest.range_min       = src.range_min;
        dest.range_max       = src.range_max;
        dest.timestamp       = (float)src.timestamp.secs + (src.timestamp.nsecs / 1000f);
        return(dest);
    }
예제 #2
0
    public static Frame LoadFrame(RosSharp.RosBridgeClient.MessageTypes.WorldMapper.Frame message)
    {
        Frame frame = new Frame();

        frame.seq             = message.seq;
        frame.timestamp       = (float)message.timestamp.secs + (((float)message.timestamp.nsecs) / 1000f);
        frame.frameid         = message.frameid;
        frame.accX            = message.accX;
        frame.accY            = message.accY;
        frame.accZ            = message.accZ;
        frame.posX            = message.posX;
        frame.posY            = message.posY;
        frame.posZ            = message.posZ;
        frame.rotX            = message.rotX;
        frame.rotY            = message.rotY;
        frame.rotZ            = message.rotZ;
        frame.gyrX            = message.gyrX;
        frame.gyrY            = message.gyrY;
        frame.gyrZ            = message.gyrZ;
        frame.angle_min       = message.angle_min;
        frame.angle_max       = message.angle_max;
        frame.angle_increment = message.angle_increment;
        frame.range_min       = message.range_min;
        frame.range_max       = message.range_max;
        frame.ranges          = message.ranges;
        frame.intensities     = message.intensities;
        frame.img             = message.img;
        frame.imgfmt          = message.imgfmt;
        return(frame);
    }
예제 #3
0
    public static ROSFrame ToROSFrame(this Frame src)
    {
        ROSFrame dest = new ROSFrame();

        dest.accX            = src.accX;
        dest.accY            = src.accY;
        dest.accZ            = src.accZ;
        dest.angle_increment = src.angle_increment;
        dest.angle_min       = src.angle_min;
        dest.angle_max       = src.angle_max;
        dest.frameid         = src.frameid;
        dest.gyrX            = src.gyrX;
        dest.gyrY            = src.gyrY;
        dest.gyrZ            = src.gyrZ;
        dest.img             = src.img;
        dest.imgfmt          = src.imgfmt;
        dest.intensities     = src.intensities;
        dest.posX            = src.posX;
        dest.posY            = src.posY;
        dest.posZ            = src.posZ;
        dest.rotX            = src.rotX;
        dest.rotY            = src.rotY;
        dest.rotZ            = src.rotZ;
        dest.seq             = src.seq;
        dest.ranges          = src.ranges;
        dest.range_min       = src.range_min;
        dest.range_max       = src.range_max;
        dest.timestamp       = new ROSTime((uint)Mathf.FloorToInt(src.timestamp), (uint)Mathf.RoundToInt((src.timestamp - Mathf.Floor(src.timestamp)) * 1000));
        return(dest);
    }
예제 #4
0
 public Frame(RosSharp.RosBridgeClient.MessageTypes.WorldMapper.Frame frame)
 {
     seq             = frame.seq;
     timestamp       = (float)frame.timestamp.secs + ((float)frame.timestamp.nsecs / 1000f);
     frameid         = frame.frameid;
     posX            = frame.posX;
     posY            = frame.posY;
     posZ            = frame.posZ;
     rotX            = frame.rotX;
     rotY            = frame.rotY;
     rotZ            = frame.rotZ;
     accX            = frame.accX;
     accY            = frame.accY;
     accZ            = frame.accZ;
     gyrX            = frame.gyrX;
     gyrY            = frame.gyrY;
     gyrZ            = frame.gyrZ;
     angle_min       = frame.angle_min;
     angle_max       = frame.angle_max;
     angle_increment = frame.angle_increment;
     range_min       = frame.range_min;
     range_max       = frame.range_max;
     ranges          = frame.ranges;
     intensities     = frame.intensities;
     img             = frame.img;
     imgfmt          = frame.imgfmt;
 }