0
$\begingroup$

Rosanswers logo

Hi

I created ROS2 packages using

ros2 pkg create package_name

Whenever, I do that, it creates a C++ package with CMakeList.txt.

I tried to use the option --build-type, but it only suggests cmake and ament_cmake as build type. There is no option for ament_python.

I want to create a python package, but could not see any means to do that. Should I write setup.py and package.xml manually or there is a command to do it?

Also, I understood that Python code should be in a Python package, and C++ code should be a C++ package and could be merged, where as in ROS1, Python and C++ can at the same package. Is my understanding correct?

PS. I am using latest bouncy version in Ubuntu Bionic.

Thanks Anis


Originally posted by Anis on ROS Answers with karma: 253 on 2018-07-23

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I assume you are referring to ros2 pkg create? This command has been added in https://github.com/ros2/ros2cli/pull/42 and atm only supports generating CMake projects. If you want to create a Python package you need to do that by hand for now (using existing Python ROS packages as templates).


Originally posted by Dirk Thomas with karma: 16276 on 2018-07-23

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Anis on 2018-07-23:
noted. thanks! that's what I did.

Comment by Karsten on 2018-07-24:
I opened a ticket for ament_python support. https://github.com/ros2/ros2cli/issues/125 I labeled it as a "good first issue", because I think the infrastructure should allow to extend it for python rather easily. So if you feel motivated, you may want to open a PR for supporting it. :)

Comment by Anis on 2018-07-25:
that will be great add this functionality.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.