Program Listing for File Transformation.hpp

Return to documentation for file (include/rmf_fleet_adapter/agv/Transformation.hpp)

/*
 * Copyright (C) 2023 Open Source Robotics Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
*/

#ifndef RMF_FLEET_ADAPTER__AGV__TRANSFORMATION_HPP
#define RMF_FLEET_ADAPTER__AGV__TRANSFORMATION_HPP

#include <rmf_utils/impl_ptr.hpp>

#include <Eigen/Geometry>

namespace rmf_fleet_adapter {
namespace agv {

//==============================================================================
class Transformation
{
public:

  Transformation(
    double rotation,
    double scale,
    Eigen::Vector2d translation);

  double rotation() const;

  double scale() const;

  const Eigen::Vector2d& translation() const;

  Eigen::Vector3d apply(const Eigen::Vector3d& position) const;

  Eigen::Vector3d apply_inverse(const Eigen::Vector3d& position) const;

  class Implementation;
private:
  rmf_utils::impl_ptr<Implementation> _pimpl;
};

} // namespace agv
} // namespace rmf_fleet_adapter

#endif // RMF_FLEET_ADAPTER__AGV__TRANSFORMATION_HPP