ros2-foxy-angles from_degrees Python example?
ROS nub
I found https://index.ros.org/p/angles/ and ros2-foxy-angles got installed by rosdep from my package.xml:
<exec_depend>angles</exec_depend>
The git says it hasn't changed but there are no foxy "API Docs" and the ROS1 docs only show C++.
Where can I find a Python example for what to import?
# get degrees to radians func
from ??? import from_degrees
self.msg_field_of_view = from_degrees(25.0) # +/- 12.5 degree FOV (~60cm at max range)
I'm starting to think Foxy does not support angles in Python. (the ROS2 setup.py refers to catkin ) My temp workaround since I only need the degrees to radians func at the moment:
# get degrees to radians func
from math import radians
self.msg_field_of_view = radians(25.0) # +/- 12.5 degree FOV (~60cm at max range)
If all else fails, it's easiest to look at the source code.
Given that
angles
isn't really that complex (it's essentially a single file) and all functions are pretty well documented, that should provide you with the information you're looking for.Thank you for responding, but nowhere in the source code does anything tell me where ROS2 installs the source code.
Case in point: looking at the source for std_msgs.msg.Float32 nowhere does it say to:
- place <exec_depends>std_msgs</exec_depends> in package.xml
- run rosdep install -i --from-path src in your ros2 workspace root
- place "from std_msgs.msg import Float32" in your Python program
and life will be great, but I figured that out from the source code AND the similarity to the ROS2 pub/sub tutorial which publishes a "String" by "from std_msgs.msg import String"
ROS2 angles python setup codeseems to indicate the Python package is "angles", and suggest "from angles import from_degrees" BUT - build succeeds - execution says:
Not the specific link I referred you to, no.
But angles/CMakeLists.txt does. And so does angles/setup.py, but that's indeed pre-ROS 2.
But in any case: I did not point you "the source code" to figure out where things are installed. I understood your question as asking "what functionality is offered by this package?".