Go to the documentation of this file.
16 #ifndef PSEN_SCAN_V2_ZONESET_CONFIGURATION_ROS_CONVERSION_H
17 #define PSEN_SCAN_V2_ZONESET_CONFIGURATION_ROS_CONVERSION_H
21 #include <geometry_msgs/Polygon.h>
24 #include "psen_scan_v2/ZoneSet.h"
25 #include "psen_scan_v2/ZoneSetConfiguration.h"
37 return deg * M_PI / 180.0;
40 geometry_msgs::Polygon
fromPolar(
const std::vector<unsigned long>& radii_in_mm,
42 const double& x_axis_rotation)
44 geometry_msgs::Polygon polygon;
46 for (
const auto& r : radii_in_mm)
48 geometry_msgs::Point32 point;
50 const auto angle = phi_step.
toRad() * i - x_axis_rotation;
51 point.x = (r / 1000.) * std::cos(
angle);
52 point.y = (r / 1000.) * std::sin(
angle);
55 polygon.points.push_back(point);
64 const std::string& frame_id,
104 return zoneset_msg_builder.
build();
108 const std::string& frame_id,
111 psen_scan_v2::ZoneSetConfiguration zoneset_config_msg;
113 for (
const auto& z : zoneset_configuration.
zonesets_)
115 zoneset_config_msg.zonesets.push_back(
toRosMsg(z, frame_id, stamp));
117 return zoneset_config_msg;
120 #endif // PSEN_SCAN_V2_ZONESET_CONFIGURATION_ROS_CONVERSION_H
ZoneSetMsgBuilder & muting1Sub2(const geometry_msgs::Polygon &muting1_Sub2)
ZoneSetMsgBuilder & muting2(const geometry_msgs::Polygon &muting2)
psen_scan_v2_standalone::util::TenthOfDegree TenthOfDegree
std::vector< unsigned long > muting2_Sub1_
ZoneSetMsgBuilder & safety1Sub0(const geometry_msgs::Polygon &safety1_Sub0)
std::vector< unsigned long > warn1_Sub2_
ZoneSetMsgBuilder & warn1Sub1(const geometry_msgs::Polygon &warn1_Sub1)
ZoneSetMsgBuilder & warn1Sub0(const geometry_msgs::Polygon &warn1_Sub0)
ZoneSetMsgBuilder & headerStamp(const ros::Time &header_stamp)
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
std::vector< unsigned long > warn2_Sub1_
ZoneSetMsgBuilder & safety1(const geometry_msgs::Polygon &safety1)
ZoneSetMsgBuilder & muting2Sub2(const geometry_msgs::Polygon &muting2_Sub2)
std::vector< ZoneSet > zonesets_
std::vector< unsigned long > warn2_Sub0_
ZoneSetMsgBuilder & safety3Sub1(const geometry_msgs::Polygon &safety3_Sub1)
ZoneSetMsgBuilder & safety3Sub0(const geometry_msgs::Polygon &safety3_Sub0)
std::vector< unsigned long > muting2_Sub0_
std::vector< unsigned long > muting1_Sub1_
ZoneSetMsgBuilder & warn2Sub2(const geometry_msgs::Polygon &warn2_Sub2)
std::vector< unsigned long > warn1_Sub0_
std::vector< unsigned long > muting1_Sub0_
ZoneSetMsgBuilder & safety2(const geometry_msgs::Polygon &safety2)
std::vector< unsigned long > safety3_Sub0_
std::vector< unsigned long > safety2_Sub0_
ZoneSetMsgBuilder & safety2Sub0(const geometry_msgs::Polygon &safety2_Sub0)
static double deg_to_rad(double deg)
std::vector< unsigned long > safety2_
ZoneSetMsgBuilder & speedUpper(const float &speed_upper)
std::vector< unsigned long > safety1_
boost::optional< ZoneSetSpeedRange > speed_range_
std::vector< unsigned long > safety1_Sub2_
ZoneSetMsgBuilder & speedLower(const float &speed_lower)
ZoneSetMsgBuilder & muting1Sub1(const geometry_msgs::Polygon &muting1_Sub1)
ZoneSetMsgBuilder & warn2(const geometry_msgs::Polygon &warn2)
std::vector< unsigned long > muting1_
ZoneSetMsgBuilder & safety3Sub2(const geometry_msgs::Polygon &safety3_Sub2)
ZoneSetMsgBuilder & muting1Sub0(const geometry_msgs::Polygon &muting1_Sub0)
ZoneSetMsgBuilder & muting2Sub1(const geometry_msgs::Polygon &muting2_Sub1)
std::vector< unsigned long > muting2_Sub2_
std::vector< unsigned long > muting1_Sub2_
ZoneSetMsgBuilder & warn1Sub2(const geometry_msgs::Polygon &warn1_Sub2)
std::vector< unsigned long > warn1_
std::vector< unsigned long > safety1_Sub0_
ZoneSetMsgBuilder & muting1(const geometry_msgs::Polygon &muting1)
std::vector< unsigned long > muting2_
ZoneSetMsgBuilder & safety2Sub1(const geometry_msgs::Polygon &safety2_Sub1)
std::vector< unsigned long > warn2_Sub2_
std::vector< unsigned long > safety2_Sub2_
ZoneSetMsgBuilder & muting2Sub0(const geometry_msgs::Polygon &muting2_Sub0)
constexpr double toRad() const
util::TenthOfDegree resolution_
ZoneSetMsgBuilder & warn2Sub1(const geometry_msgs::Polygon &warn2_Sub1)
static constexpr double DEFAULT_X_AXIS_ROTATION
The 2D scan will be rotated around the z-axis.
geometry_msgs::Polygon fromPolar(const std::vector< unsigned long > &radii_in_mm, const TenthOfDegree &phi_step, const double &x_axis_rotation)
std::vector< unsigned long > warn2_
ZoneSetMsgBuilder & safety3(const geometry_msgs::Polygon &safety3)
psen_scan_v2::ZoneSet toRosMsg(const ZoneSetStandalone &zoneset, const std::string &frame_id, const ros::Time &stamp=ros::Time::now())
ZoneSetMsgBuilder & warn1(const geometry_msgs::Polygon &warn1)
A set of simultanously active zones.
ZoneSetMsgBuilder & safety2Sub2(const geometry_msgs::Polygon &safety2_Sub2)
std::vector< unsigned long > warn1_Sub1_
ZoneSetMsgBuilder & warn2Sub0(const geometry_msgs::Polygon &warn2_Sub0)
std::vector< unsigned long > safety3_Sub2_
ZoneSetMsgBuilder & headerFrameId(const std::string &header_frame_id)
std::vector< unsigned long > safety2_Sub1_
ZoneSetMsgBuilder & safety1Sub1(const geometry_msgs::Polygon &safety1_Sub1)
std::vector< unsigned long > safety3_Sub1_
Helper class representing angles in tenth of degree.
std::vector< unsigned long > safety3_
ZoneSetMsgBuilder & safety1Sub2(const geometry_msgs::Polygon &safety1_Sub2)
std::vector< unsigned long > safety1_Sub1_
psen_scan_v2
Author(s): Pilz GmbH + Co. KG
autogenerated on Sat Jun 22 2024 02:46:12