text:
#include <mc_rbdyn/RobotLoader.h>
#include <mc_rbdyn/Robots.h>
#include <mc_rbdyn/rpy_utils.h>
#include <boost/test/unit_test.hpp>
#include "utils.h"

mc_rbdyn::Robots & get_robots()
{
  static std::shared_ptr<mc_rbdyn::Robots> robots_ptr = nullptr;
  if(robots_ptr)
  {
    return *robots_ptr;
  }
  configureRobotLoader();
  auto rm = mc_rbdyn::RobotLoader::get_robot_module("JVRC1");
  auto env = mc_rbdyn::RobotLoader::get_robot_module("env", std::string(mc_rtc::MC_ENV_DESCRIPTION_PATH),
                                                     std::string("ground"));
  robots_ptr = mc_rbdyn::loadRobots({rm, env});
  return *robots_ptr;
}

BOOST_AUTO_TEST_CASE(TestRobotPosWVelW)
{
  auto robots = get_robots();

  for(int i = 0; i < 100; ++i)
  {
    Eigen::Vector3d oriRPYRef = Eigen::Vector3d::Random();
    Eigen::Vector3d posRPYRef = Eigen::Vector3d::Random();
    sva::PTransformd refPosW(mc_rbdyn::rpyToMat(oriRPYRef), posRPYRef);
    robots.robot().posW(refPosW);
    BOOST_CHECK(robots.robot().posW().matrix().isApprox(refPosW.matrix()));
  }

  for(int i = 0; i < 100; ++i)
  {
    auto refVal = sva::MotionVecd{Eigen::Vector3d::Random(), Eigen::Vector3d::Random()};
    robots.robot().velW(refVal);
    auto actual = robots.robot().velW();
    BOOST_CHECK_MESSAGE(actual.vector().isApprox(refVal.vector()), "Error in Robot::velW"
                                                                       << "\nExpected:"
                                                                       << "\nangular:" << refVal.angular().transpose()
                                                                       << "\nlinear :" << refVal.linear().transpose()
                                                                       << "\nGot:"
                                                                       << "\nangular:" << actual.angular().transpose()
                                                                       << "\nlinear :" << actual.linear().transpose());
  }
}


text: #include <boost/geometry/iterators/dispatch/point_iterator.hpp>

ext: hpp

max_stars_repo_name: miathedev/BoostForArduino

max_issues_repo_name: miathedev/BoostForArduino

max_forks_repo_name: miathedev/BoostForArduino


text:
/* Copyright (c) 2014 Vinícius dos Santos Oliveira

   Distributed under the Boost Software License, Version 1.0. (See accompanying
   file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */

#ifndef BOOST_HTTP_SERVER_SOCKET_ADAPTOR_HPP
#define BOOST_HTTP_SERVER_SOCKET_ADAPTOR_HPP

#include <boost/http/polymorphic_server_socket.hpp>

namespace boost {
namespace http {

template<class Socket>
class server_socket_adaptor: public polymorphic_server_socket, private Socket
{
public:
    typedef Socket next_layer_type;

    template<class... Args>
    server_socket_adaptor(Args&&... args);

    next_layer_type &next_layer();

    const next_layer_type &next_layer() const;

    // ### polymorphic_socket INTERFACE IMPLEMENTATION ###
    http::read_state read_state() const override;
    http::write_state write_state() const override;
    bool write_response_native_stream() const override;
    void async_read_request(std::string &method, std::string &path,
                            message &message, callback_type handler) override;
    void async_read_some(message &message, callback_type handler) override;
    void async_read_trailers(message &message, callback_type handler) override;
    void async_write_response(std::uint_fast16_t status_code,
                              const boost::string_ref &reason_phrase,
                              const message &message, callback_type handler)
        override;
    void async_write_response_continue(callback_type handler) override;
    void async_write_response_metadata(std::uint_fast16_t status_code,
                                       const boost::string_ref &reason_phrase,
                                       const message &message,
                                       callback_type handler) override;
    void async_write(const message &message, callback_type handler) override;
    void async_write_trailers(const message &message, callback_type handler)
        override;
    void async_write_end_of_message(callback_type handler) override;
};

template<class Socket>
class server_socket_adaptor<std::reference_wrapper<Socket>>
    : public polymorphic_server_socket
{
public:
    typedef Socket next_layer_type;

    server_socket_adaptor(Socket &socket);

    server_socket_adaptor(Socket &&socket) = delete;

    next_layer_type &next_layer();

    const next_layer_type &next_layer() const;

    // ### polymorphic_socket INTERFACE IMPLEMENTATION ###
    http::read_state read_state() const override;
    http::write_state write_state() const override;
    bool write_response_native_stream() const override;
    void async_read_request(std::string &method, std::string &path,
                            message &message, callback_type handler) override;
    void async_read_some(message &message, callback_type handler) override;
    void async_read_trailers(message &message, callback_type handler) override;
    void async_write_response(std::uint_fast16_t status_code,
                              const boost::string_ref &reason_phrase,
                              const message &message, callback_type handler)
        override;
    void async_write_response_continue(callback_type handler) override;
    void async_write_response_metadata(std::uint_fast16_t status_code,
                                       const boost::string_ref &reason_phrase,
                                       const message &message,
                                       callback_type handler) override;
    void async_write(const message &message, callback_type handler) override;
    void async_write_trailers(const message &message, callback_type handler)
        override;
    void async_write_end_of_message(callback_type handler) override;

private:
    std::reference_wrapper<Socket> wrapped_socket;
};

} // namespace http
} // namespace boost

#include "server_socket_adaptor-inl.hpp"

#endif // BOOST_HTTP_SERVER_SOCKET_ADAPTOR_HPP


text:
//  Copyright (c) 2013 Jeroen Habraken
//
//  Distributed under the Boost Software License, Version 1.0. (See accompanying
//  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#ifndef HPX_COMPONENTS_SECURITY_SERVER_SIGNED_TYPE_HPP
#define HPX_COMPONENTS_SECURITY_SERVER_SIGNED_TYPE_HPP

#include <hpx/hpx_fwd.hpp>

#include <boost/serialization/serialization.hpp>
#include <boost/serialization/is_bitwise_serializable.hpp>

#include <hpx/components/security/signature.hpp>

namespace hpx { namespace components { namespace security
{
#if defined(_MSC_VER)
#  pragma pack(push, 1)
#endif

    template <typename T>
    class signed_type
    {
    public:
        signature const & get_signature() const
        {
            return signature_;
        }

        T const & get_type() const
        {
            return type_;
        }

        operator T const & () const
        {
            return type_;
        }

        static signed_type invalid_signed_type;

        friend std::ostream & operator<<(std::ostream & os,
                                         signed_type<T> const & signed_type)
        {
            return os << "<signed_type "
                      << signed_type.signature_
                      << " "
                      << signed_type.type_
                      << ">";
        }

        unsigned char* begin()
        {
            return reinterpret_cast<unsigned char*>(this);
        }
        unsigned char const* begin() const
        {
            return reinterpret_cast<unsigned char const*>(this);
        }

        unsigned char* end()
        {
            return reinterpret_cast<unsigned char*>(this) + size();
        }
        unsigned char const* end() const
        {
            return reinterpret_cast<unsigned char const*>(this) + size();
        }

        BOOST_CONSTEXPR static std::size_t size()
        {
            return sizeof(signed_type);
        }

    private:
        friend class boost::serialization::access;

        template <typename Archive>
        void serialize(Archive & ar, const unsigned int)
        {
            ar & boost::serialization::make_array(begin(), size());
        }

        signature signature_;
        T type_;
    };

#if defined(_MSC_VER)
#  pragma pack(pop)
#endif

    template <typename T>
    signed_type<T> signed_type<T>::invalid_signed_type =
        signed_type<T>();

}}}

namespace boost { namespace serialization
{
    template <typename T>
    struct is_bitwise_serializable<
            hpx::components::security::signed_type<T> >
       : mpl::true_
    {};
}}

#endif