|
| 1 | +//RosMotoPlusConversionUtils.h |
| 2 | + |
| 3 | +// SPDX-FileCopyrightText: 2023, Yaskawa America, Inc. |
| 4 | +// SPDX-FileCopyrightText: 2023, Delft University of Technology |
| 5 | +// |
| 6 | +// SPDX-License-Identifier: Apache-2.0 |
| 7 | + |
| 8 | +#ifndef MOTOROS2_ROS_MOTOPLUS_CONVERSION_UTILS_H |
| 9 | +#define MOTOROS2_ROS_MOTOPLUS_CONVERSION_UTILS_H |
| 10 | + |
| 11 | + |
| 12 | +/** |
| 13 | + * Converts an M+ `MP_COORD` struct to a ROS `geometry_msgs/msg/Pose`. |
| 14 | + * |
| 15 | + * Unit conversion is also performed by this function: |
| 16 | + * |
| 17 | + * - `MP_COORD` positions are converted from micro-meters to meters |
| 18 | + * - `MP_COORD` orientations are converted from milli-degrees to radians (and |
| 19 | + * subsequently to a `Quaternion`) |
| 20 | + * |
| 21 | + * @param mp_coord Input M+ `MP_COORD` instance |
| 22 | + * @param ros_pose Output `geometry_msgs/msg/Pose` |
| 23 | + */ |
| 24 | +extern void Ros_MpCoord_To_GeomMsgsPose(MP_COORD const* const mp_coord, geometry_msgs__msg__Pose* const ros_pose); |
| 25 | + |
| 26 | + |
| 27 | +/** |
| 28 | + * Converts an M+ `MP_COORD` struct to a ROS `geometry_msgs/msg/Transform`. |
| 29 | + * |
| 30 | + * Unit conversion is also performed by this function: |
| 31 | + * |
| 32 | + * - `MP_COORD` positions are converted from micro-meters to meters |
| 33 | + * - `MP_COORD` orientations are converted from milli-degrees to radians (and |
| 34 | + * subsequently to a `Quaternion`) |
| 35 | + * |
| 36 | + * @param mp_coord Input M+ `MP_COORD` instance |
| 37 | + * @param ros_transform Output `geometry_msgs/msg/Pose` |
| 38 | + */ |
| 39 | +extern void Ros_MpCoord_To_GeomMsgsTransform(MP_COORD const* const mp_coord, geometry_msgs__msg__Transform* const ros_transform); |
| 40 | + |
| 41 | + |
| 42 | +#endif // MOTOROS2_ROS_MOTOPLUS_CONVERSION_UTILS_H |
0 commit comments