Repository navigation
Conversation
|
There's a bug in Also, the examples currently fail with this error: @wjwwood mentioned that he recently worked on C type support and found a solution to a problem, but I don't know if it's the same as this. Hopefully it is and I can fix it 😄 |
|
lgtm It's unfortunate that the most complicated part of this pull request is the python finding. Is there a way to run ci on this? |
|
With ros2/ros2#191, the typesupport branch (rclpy-conversion-functions), and a test that exercises the Python API, we could test this branch on CI. |
| publisher->impl = NULL; | ||
| rcl_publisher_options_t publisher_ops = rcl_publisher_get_default_options(); | ||
| rcl_ret_t ret = rcl_publisher_init(publisher, node, ts, topic, &publisher_ops); | ||
| (void)ret; |
There was a problem hiding this comment.
The function warns for not checking the return value for a reason. Instead of silencing the warning here I think it should either not catch the return value (and result in a compiler warning) or this needs a TODO.
Same below.
|
More then 150 lines in the |
| LIBRARY_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}" | ||
| RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}" | ||
| OUTPUT_NAME "_${PROJECT_NAME}${target_suffix}${PYTHON_EXTENSION_SUFFIX}" | ||
| SUFFIX "${PYTHON_EXTENSION_EXTENSION}") |
There was a problem hiding this comment.
The five set_target_properties calls are almost identical and should be refactored into a function to avoid code duplication.
|
@dirk-thomas agreed. Any suggestion where these lines should go? Into ament_python? |
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| import rclpy._rclpy__rmw_opensplice_cpp as _rclpy |
There was a problem hiding this comment.
How is this supposed to be exposed in the future?
There was a problem hiding this comment.
Sorry, I forgot about this, thanks for the reminder. I imagine that in the future, we could have a CMake-generated Python module that has all the available typesupport implementations and rclpy just tries each of one. For example, let's say we have a typesuport_impls.py.in that gets populated with the typesupport implementations for OpenSplice, Connext static, Connext dynamic, etc. and they are exposed through the rclpy API. If the user does not pick an implementation (via a global function, e.g. rclpy.set_typesupport_implementation), the first one in typesupport_impls.py is picked.
|
I don't think any ament package is a good location for this logic since it simply doesn't know what might be needed downstream. Instead it should be somewhere specific to the Python generator and client library in ROS. I don't see a good common package both of them depend on (since the client library doesn't depend on the generator). Maybe a new package which both then depend on? |
|
@dirk-thomas makes sense, I'll look into that. Thanks! |
|
@dirk-thomas after merging your PR, I can't get this to install the native extensions properly. |
|
Calling |
|
The new package can not be in this repo though since that would result in a circular dependency on the repository level:
To avoid that it needs to be in the rosidl repo. |
|
@dirk-thomas thanks for the suggestion, moving the package right now. |
Initial implementation of the Python client API
This is an initial implementation of
rclpy.Depends on ros2/rosidl#73