How to determine if a package is ROS1 or ROS2?
I'm working on getting roslibrust to support ros2. What I am hoping to do is look at a directory, determine if it is a ROS1 or a ROS2 package, and then use the appropriate message parsing logic depending on the package type.
I'm looking for the canonical way for a tool to determine if a given package is a ROS1 or a ROS2 package.
The best I've been able to tell I should do this by looking for <buildtool_depend> in package.xml and assume it is a ROS1 package if I find catkin
, and a ROS2 package if I find ament_cmake
. I'm worried however that this method is not universal, as <buildtool_depend> is not listed as a required tag here.
Is there a better way? Can someone point me to documentation?