conversion.cpp
Go to the documentation of this file.
2 
3 namespace ensenso_conversion
4 {
5 geometry_msgs::Point32 toRosPoint(NxLibItem const& itemArray, bool convertUnits)
6 {
7  geometry_msgs::Point32 point;
8  if (convertUnits)
9  {
10  point.x = itemArray[0].asDouble() / conversionFactor;
11  point.y = itemArray[1].asDouble() / conversionFactor;
12  point.z = itemArray[2].asDouble() / conversionFactor;
13  }
14  else
15  {
16  point.x = itemArray[0].asDouble();
17  point.y = itemArray[1].asDouble();
18  point.z = itemArray[2].asDouble();
19  }
20 
21  return point;
22 }
23 
24 NxLibItem toEnsensoPoint(geometry_msgs::Point32 const& point, bool convertUnits)
25 {
26  NxLibItem itemPoint;
27  if (convertUnits)
28  {
29  itemPoint[0] = point.x * conversionFactor;
30  itemPoint[1] = point.y * conversionFactor;
31  itemPoint[2] = point.z * conversionFactor;
32  }
33  else
34  {
35  itemPoint[0] = point.x;
36  itemPoint[1] = point.y;
37  itemPoint[2] = point.z;
38  }
39 
40  return itemPoint;
41 }
42 
43 } // namespace ensenso_conversion
NxLibItem toEnsensoPoint(geometry_msgs::Point32 const &point, bool convertUnits=true)
Definition: conversion.cpp:24
geometry_msgs::Point32 toRosPoint(NxLibItem const &itemArray, bool convertUnits=true)
Definition: conversion.cpp:5
const int conversionFactor
Definition: conversion.h:11


ensenso_camera
Author(s): Ensenso
autogenerated on Sat Nov 9 2019 03:53:27