ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ros2: ros2 pkg create for python package problem

asked 2018-07-23 16:39:02 -0500

Anis gravatar image

updated 2018-07-23 22:37:36 -0500

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2018-07-23 17:36:29 -0500

Dirk Thomas gravatar image

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).

edit flag offensive delete link more

Comments

noted. thanks! that's what I did.

Anis gravatar image Anis  ( 2018-07-23 22:37:12 -0500 )edit

I opened a ticket for ament_python support. https://github.com/ros2/ros2cli/issue... 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. :)

Karsten gravatar image Karsten  ( 2018-07-24 15:29:32 -0500 )edit

that will be great add this functionality.

Anis gravatar image Anis  ( 2018-07-25 04:16:00 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2018-07-23 16:39:02 -0500

Seen: 1,051 times

Last updated: Jul 23 '18