Added package for the current testing gps. Also added a testing launcher folder

This commit is contained in:
2018-01-06 13:14:36 -08:00
parent f207446293
commit 2aaca71e91
111 changed files with 10550 additions and 0 deletions

View File

@@ -0,0 +1,883 @@
//==============================================================================
// Copyright (c) 2012, Johannes Meyer, TU Darmstadt
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Flight Systems and Automatic Control group,
// TU Darmstadt, nor the names of its contributors may be used to
// endorse or promote products derived from this software without
// specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//==============================================================================
#ifndef UBLOX_SERIALIZATION_UBLOX_MSGS_H
#define UBLOX_SERIALIZATION_UBLOX_MSGS_H
#include <ros/console.h>
#include <ublox/serialization.h>
#include <ublox_msgs/ublox_msgs.h>
///
/// This file declares custom serializers for u-blox messages with dynamic
/// lengths and messages where the get/set messages have different sizes, but
/// share the same parameters, such as CfgDAT.
///
namespace ublox {
///
/// @brief Serializes the CfgDAT message which has a different length for
/// get/set.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::CfgDAT_<ContainerAllocator> > {
typedef boost::call_traits<ublox_msgs::CfgDAT_<ContainerAllocator> >
CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.datumNum);
stream.next(m.datumName);
stream.next(m.majA);
stream.next(m.flat);
stream.next(m.dX);
stream.next(m.dY);
stream.next(m.dZ);
stream.next(m.rotX);
stream.next(m.rotY);
stream.next(m.rotZ);
stream.next(m.scale);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
// this is the size of CfgDAT set messages
// serializedLength is only used for writes so this is ok
return 44;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
// ignores datumNum & datumName
stream.next(m.majA);
stream.next(m.flat);
stream.next(m.dX);
stream.next(m.dY);
stream.next(m.dZ);
stream.next(m.rotX);
stream.next(m.rotY);
stream.next(m.rotZ);
stream.next(m.scale);
}
};
///
/// @brief Serializes the CfgGNSS message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::CfgGNSS_<ContainerAllocator> > {
typedef ublox_msgs::CfgGNSS_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.msgVer);
stream.next(m.numTrkChHw);
stream.next(m.numTrkChUse);
stream.next(m.numConfigBlocks);
m.blocks.resize(m.numConfigBlocks);
for(std::size_t i = 0; i < m.blocks.size(); ++i)
ros::serialization::deserialize(stream, m.blocks[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 4 + 8 * m.numConfigBlocks;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.blocks.size() != m.numConfigBlocks) {
ROS_ERROR("CfgGNSS numConfigBlocks must equal blocks size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.msgVer);
stream.next(m.numTrkChHw);
stream.next(m.numTrkChUse);
stream.next(
static_cast<typename Msg::_numConfigBlocks_type>(m.blocks.size()));
for(std::size_t i = 0; i < m.blocks.size(); ++i)
ros::serialization::serialize(stream, m.blocks[i]);
}
};
///
/// @brief Serializes the CfgInf message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::CfgINF_<ContainerAllocator> > {
typedef boost::call_traits<ublox_msgs::CfgINF_<ContainerAllocator> >
CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
int num_blocks = count / 10;
m.blocks.resize(num_blocks);
for(std::size_t i = 0; i < num_blocks; ++i)
ros::serialization::deserialize(stream, m.blocks[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 10 * m.blocks.size();
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
for(std::size_t i = 0; i < m.blocks.size(); ++i)
ros::serialization::serialize(stream, m.blocks[i]);
}
};
///
/// @brief Serializes the Inf message which has a dynamic length string.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::Inf_<ContainerAllocator> > {
typedef boost::call_traits<ublox_msgs::Inf_<ContainerAllocator> > CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
m.str.resize(count);
for (int i = 0; i < count; ++i)
ros::serialization::deserialize(stream, m.str[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return m.str.size();
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
for(std::size_t i = 0; i < m.str.size(); ++i)
ros::serialization::serialize(stream, m.str[i]);
}
};
///
/// @brief Serializes the MonVER message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::MonVER_<ContainerAllocator> > {
typedef ublox_msgs::MonVER_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.swVersion);
stream.next(m.hwVersion);
m.extension.clear();
int N = (count - 40) / 30;
m.extension.reserve(N);
typename Msg::_extension_type::value_type ext;
for (int i = 0; i < N; i++) {
// Read each extension string
stream.next(ext);
m.extension.push_back(ext);
}
}
static uint32_t serializedLength(typename CallTraits::param_type m) {
return 40 + (30 * m.extension.size());
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
stream.next(m.swVersion);
stream.next(m.hwVersion);
for(std::size_t i = 0; i < m.extension.size(); ++i)
ros::serialization::serialize(stream, m.extension[i]);
}
};
///
/// @brief Serializes the NavDGPS message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::NavDGPS_<ContainerAllocator> > {
typedef ublox_msgs::NavDGPS_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.iTOW);
stream.next(m.age);
stream.next(m.baseId);
stream.next(m.baseHealth);
stream.next(m.numCh);
stream.next(m.status);
stream.next(m.reserved1);
m.sv.resize(m.numCh);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::deserialize(stream, m.sv[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 16 + 12 * m.numCh;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.sv.size() != m.numCh) {
ROS_ERROR("NavDGPS numCh must equal sv size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.iTOW);
stream.next(m.age);
stream.next(m.baseId);
stream.next(m.baseHealth);
stream.next(static_cast<typename Msg::_numCh_type>(m.sv.size()));
stream.next(m.status);
stream.next(m.reserved1);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::serialize(stream, m.sv[i]);
}
};
///
/// @brief Serializes the NavSBAS message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::NavSBAS_<ContainerAllocator> > {
typedef ublox_msgs::NavSBAS_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.iTOW);
stream.next(m.geo);
stream.next(m.mode);
stream.next(m.sys);
stream.next(m.service);
stream.next(m.cnt);
stream.next(m.reserved0);
m.sv.resize(m.cnt);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::deserialize(stream, m.sv[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 12 + 12 * m.cnt;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.sv.size() != m.cnt) {
ROS_ERROR("NavSBAS cnt must equal sv size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.iTOW);
stream.next(m.geo);
stream.next(m.mode);
stream.next(m.sys);
stream.next(m.service);
stream.next(static_cast<typename Msg::_cnt_type>(m.sv.size()));
stream.next(m.reserved0);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::serialize(stream, m.sv[i]);
}
};
///
/// @brief Serializes the NavSAT message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::NavSAT_<ContainerAllocator> > {
typedef ublox_msgs::NavSAT_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.iTOW);
stream.next(m.version);
stream.next(m.numSvs);
stream.next(m.reserved0);
m.sv.resize(m.numSvs);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::deserialize(stream, m.sv[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + 12 * m.numSvs;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.sv.size() != m.numSvs) {
ROS_ERROR("NavSAT numSvs must equal sv size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.iTOW);
stream.next(m.version);
stream.next(static_cast<typename Msg::_numSvs_type>(m.sv.size()));
stream.next(m.reserved0);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::serialize(stream, m.sv[i]);
}
};
///
/// @brief Serializes the NavDGPS message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::NavSVINFO_<ContainerAllocator> > {
typedef ublox_msgs::NavSVINFO_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.iTOW);
stream.next(m.numCh);
stream.next(m.globalFlags);
stream.next(m.reserved2);
m.sv.resize(m.numCh);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::deserialize(stream, m.sv[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + 12 * m.numCh;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.sv.size() != m.numCh) {
ROS_ERROR("NavSVINFO numCh must equal sv size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.iTOW);
stream.next(static_cast<typename Msg::_numCh_type>(m.sv.size()));
stream.next(m.globalFlags);
stream.next(m.reserved2);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::serialize(stream, m.sv[i]);
}
};
///
/// @brief Serializes the RxmRAW message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::RxmRAW_<ContainerAllocator> > {
typedef ublox_msgs::RxmRAW_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.rcvTOW);
stream.next(m.week);
stream.next(m.numSV);
stream.next(m.reserved1);
m.sv.resize(m.numSV);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::deserialize(stream, m.sv[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + 24 * m.numSV;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.sv.size() != m.numSV) {
ROS_ERROR("RxmRAW numSV must equal sv size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.rcvTOW);
stream.next(m.week);
stream.next(static_cast<typename Msg::_numSV_type>(m.sv.size()));
stream.next(m.reserved1);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::serialize(stream, m.sv[i]);
}
};
///
/// @brief Serializes the RxmRAWX message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::RxmRAWX_<ContainerAllocator> > {
typedef ublox_msgs::RxmRAWX_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.rcvTOW);
stream.next(m.week);
stream.next(m.leapS);
stream.next(m.numMeas);
stream.next(m.recStat);
stream.next(m.version);
stream.next(m.reserved1);
m.meas.resize(m.numMeas);
for(std::size_t i = 0; i < m.meas.size(); ++i)
ros::serialization::deserialize(stream, m.meas[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 16 + 32 * m.numMeas;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.meas.size() != m.numMeas) {
ROS_ERROR("RxmRAWX numMeas must equal meas size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.rcvTOW);
stream.next(m.week);
stream.next(m.leapS);
stream.next(static_cast<typename Msg::_numMeas_type>(m.meas.size()));
stream.next(m.recStat);
stream.next(m.version);
stream.next(m.reserved1);
for(std::size_t i = 0; i < m.meas.size(); ++i)
ros::serialization::serialize(stream, m.meas[i]);
}
};
///
/// @brief Serializes the RxmSFRBX message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::RxmSFRBX_<ContainerAllocator> > {
typedef ublox_msgs::RxmSFRBX_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.gnssId);
stream.next(m.svId);
stream.next(m.reserved0);
stream.next(m.freqId);
stream.next(m.numWords);
stream.next(m.chn);
stream.next(m.version);
stream.next(m.reserved1);
m.dwrd.resize(m.numWords);
for(std::size_t i = 0; i < m.dwrd.size(); ++i)
ros::serialization::deserialize(stream, m.dwrd[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + 4 * m.numWords;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.dwrd.size() != m.numWords) {
ROS_ERROR("RxmSFRBX numWords must equal dwrd size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.gnssId);
stream.next(m.svId);
stream.next(m.reserved0);
stream.next(m.freqId);
stream.next(static_cast<typename Msg::_numWords_type>(m.dwrd.size()));
stream.next(m.chn);
stream.next(m.version);
stream.next(m.reserved1);
for(std::size_t i = 0; i < m.dwrd.size(); ++i)
ros::serialization::serialize(stream, m.dwrd[i]);
}
};
///
/// @brief Serializes the RxmSVSI message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::RxmSVSI_<ContainerAllocator> > {
typedef ublox_msgs::RxmSVSI_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.iTOW);
stream.next(m.week);
stream.next(m.numVis);
stream.next(m.numSV);
m.sv.resize(m.numSV);
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::deserialize(stream, m.sv[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + 6 * m.numSV;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.sv.size() != m.numSV) {
ROS_ERROR("RxmSVSI numSV must equal sv size");
}
ros::serialization::OStream stream(data, size);
stream.next(m.iTOW);
stream.next(m.week);
stream.next(m.numVis);
stream.next(static_cast<typename Msg::_numSV_type>(m.sv.size()));
for(std::size_t i = 0; i < m.sv.size(); ++i)
ros::serialization::serialize(stream, m.sv[i]);
}
};
///
/// @brief Serializes the RxmALM message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::RxmALM_<ContainerAllocator> > {
typedef ublox_msgs::RxmALM_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.svid);
stream.next(m.week);
m.dwrd.clear();
if(count == 40) {
typename Msg::_dwrd_type::value_type temp;
m.dwrd.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp);
m.dwrd.push_back(temp);
}
}
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + (4 * m.dwrd.size());
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
stream.next(m.svid);
stream.next(m.week);
for(std::size_t i = 0; i < m.dwrd.size(); ++i)
ros::serialization::serialize(stream, m.dwrd[i]);
}
};
///
/// @brief Serializes the RxmEPH message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::RxmEPH_<ContainerAllocator> >
{
typedef ublox_msgs::RxmEPH_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.svid);
stream.next(m.how);
m.sf1d.clear();
m.sf2d.clear();
m.sf3d.clear();
if (count == 104) {
typename Msg::_sf1d_type::value_type temp1;
typename Msg::_sf2d_type::value_type temp2;
typename Msg::_sf3d_type::value_type temp3;
m.sf1d.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp1);
m.sf1d.push_back(temp1);
}
m.sf2d.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp2);
m.sf2d.push_back(temp2);
}
m.sf3d.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp3);
m.sf3d.push_back(temp3);
}
}
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
stream.next(m.svid);
stream.next(m.how);
for(std::size_t i = 0; i < m.sf1d.size(); ++i)
ros::serialization::serialize(stream, m.sf1d[i]);
for(std::size_t i = 0; i < m.sf2d.size(); ++i)
ros::serialization::serialize(stream, m.sf2d[i]);
for(std::size_t i = 0; i < m.sf3d.size(); ++i)
ros::serialization::serialize(stream, m.sf3d[i]);
}
};
///
/// @brief Serializes the AidALM message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::AidALM_<ContainerAllocator> > {
typedef ublox_msgs::AidALM_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.svid);
stream.next(m.week);
m.dwrd.clear();
if (count == 40) {
typename Msg::_dwrd_type::value_type temp;
m.dwrd.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp);
m.dwrd.push_back(temp);
}
}
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + (4 * m.dwrd.size());
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
stream.next(m.svid);
stream.next(m.week);
for(std::size_t i = 0; i < m.dwrd.size(); ++i)
ros::serialization::serialize(stream, m.dwrd[i]);
}
};
///
/// @brief Serializes the AidEPH message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::AidEPH_<ContainerAllocator> >
{
typedef ublox_msgs::AidEPH_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.svid);
stream.next(m.how);
m.sf1d.clear();
m.sf2d.clear();
m.sf3d.clear();
if (count == 104) {
typename Msg::_sf1d_type::value_type temp1;
typename Msg::_sf2d_type::value_type temp2;
typename Msg::_sf3d_type::value_type temp3;
m.sf1d.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp1);
m.sf1d.push_back(temp1);
}
m.sf2d.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp2);
m.sf2d.push_back(temp2);
}
m.sf3d.resize(8);
for(std::size_t i = 0; i < 8; ++i) {
stream.next(temp3);
m.sf3d.push_back(temp3);
}
}
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 8 + (4 * m.sf1d.size()) + (4 * m.sf2d.size()) + (4 * m.sf3d.size());
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
stream.next(m.svid);
stream.next(m.how);
for(std::size_t i = 0; i < m.sf1d.size(); ++i)
ros::serialization::serialize(stream, m.sf1d[i]);
for(std::size_t i = 0; i < m.sf2d.size(); ++i)
ros::serialization::serialize(stream, m.sf2d[i]);
for(std::size_t i = 0; i < m.sf3d.size(); ++i)
ros::serialization::serialize(stream, m.sf3d[i]);
}
};
///
/// @brief Serializes the EsfMEAS message which has a repeated block and an
/// optional block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::EsfMEAS_<ContainerAllocator> > {
typedef boost::call_traits<ublox_msgs::EsfMEAS_<ContainerAllocator> >
CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.timeTag);
stream.next(m.flags);
stream.next(m.id);
bool calib_valid = m.flags & m.FLAGS_CALIB_T_TAG_VALID;
int data_size = (count - (calib_valid ? 12 : 8)) / 4;
// Repeating block
m.data.resize(data_size);
for(std::size_t i = 0; i < data_size; ++i)
ros::serialization::deserialize(stream, m.data[i]);
// Optional block
if(calib_valid) {
m.calibTtag.resize(1);
ros::serialization::deserialize(stream, m.calibTtag[0]);
}
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 4 + 8 * m.data.size() + 4 * m.calibTtag.size();
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
stream.next(m.timeTag);
stream.next(m.flags);
stream.next(m.id);
for(std::size_t i = 0; i < m.data.size(); ++i)
ros::serialization::serialize(stream, m.data[i]);
for(std::size_t i = 0; i < m.calibTtag.size(); ++i)
ros::serialization::serialize(stream, m.calibTtag[i]);
}
};
///
/// @brief Serializes the EsfRAW message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::EsfRAW_<ContainerAllocator> > {
typedef boost::call_traits<ublox_msgs::EsfRAW_<ContainerAllocator> >
CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.reserved0);
m.blocks.clear();
int num_blocks = (count - 4) / 8;
m.blocks.resize(num_blocks);
for(std::size_t i = 0; i < num_blocks; ++i)
ros::serialization::deserialize(stream, m.blocks[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 4 + 8 * m.blocks.size();
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
ros::serialization::OStream stream(data, size);
stream.next(m.reserved0);
for(std::size_t i = 0; i < m.blocks.size(); ++i)
ros::serialization::serialize(stream, m.blocks[i]);
}
};
///
/// @brief Serializes the EsfSTATUS message which has a repeated block.
///
template <typename ContainerAllocator>
struct Serializer<ublox_msgs::EsfSTATUS_<ContainerAllocator> > {
typedef ublox_msgs::EsfSTATUS_<ContainerAllocator> Msg;
typedef boost::call_traits<Msg> CallTraits;
static void read(const uint8_t *data, uint32_t count,
typename CallTraits::reference m) {
ros::serialization::IStream stream(const_cast<uint8_t *>(data), count);
stream.next(m.iTOW);
stream.next(m.version);
stream.next(m.fusionMode);
stream.next(m.reserved2);
stream.next(m.numSens);
m.sens.resize(m.numSens);
for(std::size_t i = 0; i < m.sens.size(); ++i)
ros::serialization::deserialize(stream, m.sens[i]);
}
static uint32_t serializedLength (typename CallTraits::param_type m) {
return 16 + 4 * m.numSens;
}
static void write(uint8_t *data, uint32_t size,
typename CallTraits::param_type m) {
if(m.sens.size() != m.numSens) {
ROS_ERROR("Writing EsfSTATUS message: numSens must equal size of sens");
}
ros::serialization::OStream stream(data, size);
stream.next(m.iTOW);
stream.next(m.version);
stream.next(m.fusionMode);
stream.next(m.reserved2);
stream.next(static_cast<typename Msg::_numSens_type>(m.sens.size()));
for(std::size_t i = 0; i < m.sens.size(); ++i)
ros::serialization::serialize(stream, m.sens[i]);
}
};
} // namespace ublox
#endif // UBLOX_SERIALIZATION_UBLOX_MSGS_H

View File

@@ -0,0 +1,251 @@
//==============================================================================
// Copyright (c) 2012, Johannes Meyer, TU Darmstadt
// All rights reserved.
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the Flight Systems and Automatic Control group,
// TU Darmstadt, nor the names of its contributors may be used to
// endorse or promote products derived from this software without
// specific prior written permission.
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//==============================================================================
#ifndef UBLOX_MSGS_H
#define UBLOX_MSGS_H
#include <ublox_msgs/NavATT.h>
#include <ublox_msgs/NavCLOCK.h>
#include <ublox_msgs/NavDGPS.h>
#include <ublox_msgs/NavDOP.h>
#include <ublox_msgs/NavPOSECEF.h>
#include <ublox_msgs/NavPOSLLH.h>
#include <ublox_msgs/NavRELPOSNED.h>
#include <ublox_msgs/NavSBAS.h>
#include <ublox_msgs/NavSOL.h>
#include <ublox_msgs/NavPVT.h>
#include <ublox_msgs/NavPVT7.h>
#include <ublox_msgs/NavSTATUS.h>
#include <ublox_msgs/NavSAT.h>
#include <ublox_msgs/NavSVIN.h>
#include <ublox_msgs/NavSVINFO.h>
#include <ublox_msgs/NavTIMEGPS.h>
#include <ublox_msgs/NavTIMEUTC.h>
#include <ublox_msgs/NavVELECEF.h>
#include <ublox_msgs/NavVELNED.h>
#include <ublox_msgs/RxmALM.h>
#include <ublox_msgs/RxmEPH.h>
#include <ublox_msgs/RxmRAW.h>
#include <ublox_msgs/RxmRAW_SV.h>
#include <ublox_msgs/RxmRAWX.h>
#include <ublox_msgs/RxmRAWX_Meas.h>
#include <ublox_msgs/RxmRTCM.h>
#include <ublox_msgs/RxmSFRB.h>
#include <ublox_msgs/RxmSFRBX.h>
#include <ublox_msgs/RxmSVSI.h>
#include <ublox_msgs/Inf.h>
#include <ublox_msgs/Ack.h>
#include <ublox_msgs/CfgANT.h>
#include <ublox_msgs/CfgCFG.h>
#include <ublox_msgs/CfgDAT.h>
#include <ublox_msgs/CfgDGNSS.h>
#include <ublox_msgs/CfgGNSS.h>
#include <ublox_msgs/CfgHNR.h>
#include <ublox_msgs/CfgINF.h>
#include <ublox_msgs/CfgINF_Block.h>
#include <ublox_msgs/CfgMSG.h>
#include <ublox_msgs/CfgNAV5.h>
#include <ublox_msgs/CfgNAVX5.h>
#include <ublox_msgs/CfgNMEA.h>
#include <ublox_msgs/CfgNMEA6.h>
#include <ublox_msgs/CfgNMEA7.h>
#include <ublox_msgs/CfgPRT.h>
#include <ublox_msgs/CfgRATE.h>
#include <ublox_msgs/CfgRST.h>
#include <ublox_msgs/CfgSBAS.h>
#include <ublox_msgs/CfgTMODE3.h>
#include <ublox_msgs/CfgUSB.h>
#include <ublox_msgs/UpdSOS.h>
#include <ublox_msgs/UpdSOS_Ack.h>
#include <ublox_msgs/MonGNSS.h>
#include <ublox_msgs/MonHW.h>
#include <ublox_msgs/MonHW6.h>
#include <ublox_msgs/MonVER.h>
#include <ublox_msgs/AidALM.h>
#include <ublox_msgs/AidEPH.h>
#include <ublox_msgs/AidHUI.h>
#include <ublox_msgs/EsfINS.h>
#include <ublox_msgs/EsfMEAS.h>
#include <ublox_msgs/EsfRAW.h>
#include <ublox_msgs/EsfSTATUS.h>
#include <ublox_msgs/EsfSTATUS_Sens.h>
#include <ublox_msgs/MgaGAL.h>
#include <ublox_msgs/HnrPVT.h>
namespace ublox_msgs {
namespace Class {
static const uint8_t NAV = 0x01; //!< Navigation Result Messages: Position,
//!< Speed, Time, Acceleration, Heading,
//!< DOP, SVs used
static const uint8_t RXM = 0x02; //!< Receiver Manager Messages:
//!< Satellite Status, RTC Status
static const uint8_t INF = 0x04; //!< Information Messages:
//!< Printf-Style Messages, with IDs such as
//!< Error, Warning, Notice
static const uint8_t ACK = 0x05; //!< Ack/Nack Messages: Acknowledge or Reject
//!< messages to CFG input messages
static const uint8_t CFG = 0x06; //!< Configuration Input Messages: Set
//!< Dynamic Model, Set DOP Mask, Set Baud
//!< Rate, etc.
static const uint8_t UPD = 0x09; //!< Firmware Update Messages: i.e.
//!< Memory/Flash erase/write, Reboot, Flash
//!< identification, etc.
//!< Used to update the firmware and identify
//!< any attached flash device
static const uint8_t MON = 0x0A; //!< Monitoring Messages: Communication
//!< Status, CPU Load, Stack Usage,
//!< Task Status
static const uint8_t AID = 0x0B; //!< AssistNow Aiding Messages: Ephemeris,
//!< Almanac, other A-GPS data input
static const uint8_t TIM = 0x0D; //!< Timing Messages: Timepulse Output,
//!< Timemark Results
static const uint8_t ESF = 0x10; //!< External Sensor Fusion Messages:
//!< External sensor measurements and status
//!< information
static const uint8_t MGA = 0x13; //!< Multiple GNSS Assistance Messages:
//!< Assistance data for various GNSS
static const uint8_t LOG = 0x21; //!< Logging Messages: Log creation,
//!< deletion, info and retrieval
static const uint8_t SEC = 0x27; //!< Security Feature Messages
static const uint8_t HNR = 0x28; //!< High Rate Navigation Results Messages:
//!< High rate time, position, speed, heading
static const uint8_t RTCM = 0xF5; //!< RTCM Configuration Messages
}
namespace Message {
namespace NAV {
static const uint8_t ATT = NavATT::MESSAGE_ID;
static const uint8_t CLOCK = NavCLOCK::MESSAGE_ID;
static const uint8_t DGPS = NavDGPS::MESSAGE_ID;
static const uint8_t DOP = NavDOP::MESSAGE_ID;
static const uint8_t POSECEF = NavPOSECEF::MESSAGE_ID;
static const uint8_t POSLLH = NavPOSLLH::MESSAGE_ID;
static const uint8_t RELPOSNED = NavRELPOSNED::MESSAGE_ID;
static const uint8_t SBAS = NavSBAS::MESSAGE_ID;
static const uint8_t SOL = NavSOL::MESSAGE_ID;
static const uint8_t PVT = NavPVT::MESSAGE_ID;
static const uint8_t SAT = NavSAT::MESSAGE_ID;
static const uint8_t STATUS = NavSTATUS::MESSAGE_ID;
static const uint8_t SVINFO = NavSVINFO::MESSAGE_ID;
static const uint8_t SVIN = NavSVIN::MESSAGE_ID;
static const uint8_t TIMEGPS = NavTIMEGPS::MESSAGE_ID;
static const uint8_t TIMEUTC = NavTIMEUTC::MESSAGE_ID;
static const uint8_t VELECEF = NavVELECEF::MESSAGE_ID;
static const uint8_t VELNED = NavVELNED::MESSAGE_ID;
}
namespace RXM {
static const uint8_t ALM = RxmALM::MESSAGE_ID;
static const uint8_t EPH = RxmEPH::MESSAGE_ID;
static const uint8_t RAW = RxmRAW::MESSAGE_ID;
static const uint8_t RAWX = RxmRAWX::MESSAGE_ID;
static const uint8_t RTCM = RxmRTCM::MESSAGE_ID;
static const uint8_t SFRB = RxmSFRB::MESSAGE_ID;
static const uint8_t SFRBX = RxmSFRBX::MESSAGE_ID;
static const uint8_t SVSI = RxmSVSI::MESSAGE_ID;
}
namespace INF {
static const uint8_t ERROR = 0x00;
static const uint8_t WARNING = 0x01;
static const uint8_t NOTICE = 0x02;
static const uint8_t TEST = 0x03;
static const uint8_t DEBUG = 0x04;
}
namespace ACK {
static const uint8_t NACK = 0x00;
static const uint8_t ACK = 0x01;
}
namespace AID {
static const uint8_t ALM = AidALM::MESSAGE_ID;
static const uint8_t EPH = AidEPH::MESSAGE_ID;
static const uint8_t HUI = AidHUI::MESSAGE_ID;
}
namespace CFG {
static const uint8_t ANT = CfgANT::MESSAGE_ID;
static const uint8_t CFG = CfgCFG::MESSAGE_ID;
static const uint8_t DAT = CfgDAT::MESSAGE_ID;
static const uint8_t GNSS = CfgGNSS::MESSAGE_ID;
static const uint8_t HNR = CfgHNR::MESSAGE_ID;
static const uint8_t INF = CfgINF::MESSAGE_ID;
static const uint8_t DGNSS = CfgDGNSS::MESSAGE_ID;
static const uint8_t MSG = CfgMSG::MESSAGE_ID;
static const uint8_t NAV5 = CfgNAV5::MESSAGE_ID;
static const uint8_t NAVX5 = CfgNAVX5::MESSAGE_ID;
static const uint8_t NMEA = CfgNMEA::MESSAGE_ID;
static const uint8_t PRT = CfgPRT::MESSAGE_ID;
static const uint8_t RATE = CfgRATE::MESSAGE_ID;
static const uint8_t RST = CfgRST::MESSAGE_ID;
static const uint8_t SBAS = CfgSBAS::MESSAGE_ID;
static const uint8_t TMODE3 = CfgTMODE3::MESSAGE_ID;
static const uint8_t USB = CfgUSB::MESSAGE_ID;
}
namespace UPD {
//! SOS and SOS_Ack have the same message ID, but different lengths
static const uint8_t SOS = UpdSOS::MESSAGE_ID;
}
namespace MON {
static const uint8_t GNSS = MonGNSS::MESSAGE_ID;
static const uint8_t HW = MonHW::MESSAGE_ID;
static const uint8_t VER = MonVER::MESSAGE_ID;
}
namespace ESF {
static const uint8_t INS = EsfINS::MESSAGE_ID;
static const uint8_t MEAS = EsfMEAS::MESSAGE_ID;
static const uint8_t RAW = EsfRAW::MESSAGE_ID;
static const uint8_t STATUS = EsfSTATUS::MESSAGE_ID;
}
namespace MGA {
static const uint8_t GAL = MgaGAL::MESSAGE_ID;
}
namespace HNR {
static const uint8_t PVT = HnrPVT::MESSAGE_ID;
}
}
} //!< namespace ublox_msgs
#endif //!< UBLOX_MSGS_H