//our changes:

            public NavSatFixMsg(double lat, double lng, double alt)
            {
                _header  = new std_msgs.HeaderMsg(0, new std_msgs.TimeMsg(0, 0), "hello");
                _status  = (NavSatStatus)(-2);
                _service = (NavSatService)0;

                _latitude  = lat;
                _longitude = lng;
                _altitude  = alt;


                //JSONArray temp_covar_array = new JSONArray();
                _position_covariance      = new double[1];
                _position_covariance_type = (PositionCovarianceType)(-1);
            }
Ejemplo n.º 2
0
            public NavSatFixMsg(JSONNode msg)
            {
                _header    = new std_msgs.HeaderMsg(msg["header"]);
                _status    = (NavSatStatus)msg["status"]["status"].AsInt;
                _service   = (NavSatService)msg["status"]["service"].AsInt;
                _latitude  = msg["latitude"].AsFloat;
                _longitude = msg["longitude"].AsFloat;
                _altitude  = msg["altitude"].AsFloat;

                JSONArray temp_covar_array = msg["position_covariance"].AsArray;

                _position_covariance = new double[temp_covar_array.Count];
                for (int i = 0; i < _position_covariance.Length; i++)
                {
                    _position_covariance[i] = temp_covar_array[i].AsDouble;
                }

                _position_covariance_type = (PositionCovarianceType)msg["position_covariance_type"].AsInt;
            }