/*
 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
 * SPDX-License-Identifier: BSD-3-Clause
 */

// Autogenerated by Thrift Compiler (0.14.1-yarped)
//
// This is an automatically generated file.
// It could get re-generated if the ALLOW_IDL_GENERATION flag is on.

#ifndef YARP_THRIFT_GENERATOR_STRUCT_ODOMETRYDATA_H
#define YARP_THRIFT_GENERATOR_STRUCT_ODOMETRYDATA_H

#include <yarp/dev/api.h>

#include <yarp/os/Wire.h>
#include <yarp/os/idl/WireTypes.h>

namespace yarp::dev {

class YARP_dev_API OdometryData :
        public yarp::os::idl::WirePortable
{
public:
    // Fields
    /**
     * position of the robot [m], expressed in the world reference frame
     */
    double odom_x{0.0};
    /**
     * position of the robot [m], expressed in the world reference frame
     */
    double odom_y{0.0};
    /**
     * orientation the robot [deg], expressed in the world reference frame
     */
    double odom_theta{0.0};
    /**
     * velocity of the robot [m/s] expressed in the robot reference frame
     */
    double base_vel_x{0.0};
    /**
     * velocity of the robot [m/s] expressed in the robot reference frame
     */
    double base_vel_y{0.0};
    /**
     * angular velocity of the robot [deg/s] expressed in the robot reference frame
     */
    double base_vel_theta{0.0};
    /**
     * velocity of the robot [m/s] expressed in the world reference frame
     */
    double odom_vel_x{0.0};
    /**
     * velocity of the robot [m/s] expressed in the world reference frame
     */
    double odom_vel_y{0.0};
    /**
     * angular velocity of the robot [deg/s] expressed in the world reference frame
     */
    double odom_vel_theta{0.0};

    // Default constructor
    OdometryData() = default;

    // Constructor with field values
    OdometryData(const double odom_x,
                 const double odom_y,
                 const double odom_theta,
                 const double base_vel_x,
                 const double base_vel_y,
                 const double base_vel_theta,
                 const double odom_vel_x,
                 const double odom_vel_y,
                 const double odom_vel_theta);

    // Read structure on a Wire
    bool read(yarp::os::idl::WireReader& reader) override;

    // Read structure on a Connection
    bool read(yarp::os::ConnectionReader& connection) override;

    // Write structure on a Wire
    bool write(const yarp::os::idl::WireWriter& writer) const override;

    // Write structure on a Connection
    bool write(yarp::os::ConnectionWriter& connection) const override;

    // Convert to a printable string
    std::string toString() const;

    // If you want to serialize this class without nesting, use this helper
    typedef yarp::os::idl::Unwrapped<OdometryData> unwrapped;

private:
    // read/write odom_x field
    bool read_odom_x(yarp::os::idl::WireReader& reader);
    bool write_odom_x(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_odom_x(yarp::os::idl::WireReader& reader);
    bool nested_write_odom_x(const yarp::os::idl::WireWriter& writer) const;

    // read/write odom_y field
    bool read_odom_y(yarp::os::idl::WireReader& reader);
    bool write_odom_y(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_odom_y(yarp::os::idl::WireReader& reader);
    bool nested_write_odom_y(const yarp::os::idl::WireWriter& writer) const;

    // read/write odom_theta field
    bool read_odom_theta(yarp::os::idl::WireReader& reader);
    bool write_odom_theta(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_odom_theta(yarp::os::idl::WireReader& reader);
    bool nested_write_odom_theta(const yarp::os::idl::WireWriter& writer) const;

    // read/write base_vel_x field
    bool read_base_vel_x(yarp::os::idl::WireReader& reader);
    bool write_base_vel_x(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_base_vel_x(yarp::os::idl::WireReader& reader);
    bool nested_write_base_vel_x(const yarp::os::idl::WireWriter& writer) const;

    // read/write base_vel_y field
    bool read_base_vel_y(yarp::os::idl::WireReader& reader);
    bool write_base_vel_y(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_base_vel_y(yarp::os::idl::WireReader& reader);
    bool nested_write_base_vel_y(const yarp::os::idl::WireWriter& writer) const;

    // read/write base_vel_theta field
    bool read_base_vel_theta(yarp::os::idl::WireReader& reader);
    bool write_base_vel_theta(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_base_vel_theta(yarp::os::idl::WireReader& reader);
    bool nested_write_base_vel_theta(const yarp::os::idl::WireWriter& writer) const;

    // read/write odom_vel_x field
    bool read_odom_vel_x(yarp::os::idl::WireReader& reader);
    bool write_odom_vel_x(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_odom_vel_x(yarp::os::idl::WireReader& reader);
    bool nested_write_odom_vel_x(const yarp::os::idl::WireWriter& writer) const;

    // read/write odom_vel_y field
    bool read_odom_vel_y(yarp::os::idl::WireReader& reader);
    bool write_odom_vel_y(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_odom_vel_y(yarp::os::idl::WireReader& reader);
    bool nested_write_odom_vel_y(const yarp::os::idl::WireWriter& writer) const;

    // read/write odom_vel_theta field
    bool read_odom_vel_theta(yarp::os::idl::WireReader& reader);
    bool write_odom_vel_theta(const yarp::os::idl::WireWriter& writer) const;
    bool nested_read_odom_vel_theta(yarp::os::idl::WireReader& reader);
    bool nested_write_odom_vel_theta(const yarp::os::idl::WireWriter& writer) const;
};

} // namespace yarp::dev

#endif // YARP_THRIFT_GENERATOR_STRUCT_ODOMETRYDATA_H
