Code Monkey home page Code Monkey logo

rclc's Introduction

The rclc repository

This repository provides the rclc package, which complements the ROS Client Support Library (rcl) to make up a complete ROS 2 client library for the C programming language. That is, rclc does not add a new layer of types on top of rcl (like rclcpp and rclpy do) but only provides convenience functions that ease the programming with the rcl types. New types are introduced only for concepts that are missing in rcl, most important an Executor, Lifecycle Node and the Parameter server.

In detail, this repository contains four packages:

  • rclc provides the mentioned convenience functions for creating instances of publishers, subscriptions, nodes, etc. with the corresponding rcl types. Furthermore, it provides the rclc Executor for C, analogously to rclcpp's Executor class for C++. A key feature compared to the rclcpp Executor is that it includes features for implementing deterministic timing behavior.
  • rclc_lifecycle introduces an rclc Lifecycle Node, bundling an rcl Node and the lifecycle state machine from the rcl_lifecycle package.
  • rclc_examples provides small examples for the use of the convenience functions and the rclc Executor, as well as a small example for the use of the rclc Lifecycle Node.
  • rclc_parameter provides convenience functions for creating parameter server instances with full ROS2 parameters client compatibility.

Technical information on the interfaces and the usage of these packages is given in the README.md files in the corresponding subfolders.

The quality declarations for the packages are avaiable in QUALITY_DECLARATION.md files in the corresponding subfolders.

Purpose of the project

The software is not ready for production use. It has neither been developed nor tested for a specific use case. However, the license conditions of the applicable Open Source licenses allow you to adapt the software to your needs. Before using it in a safety relevant setting, make sure that the software fulfills your requirements and adjust it according to any applicable safety standards (e.g. ISO 26262).

Requirements, how to build, test and install

Source your ROS2 distribution with source /opt/ros/distribution/setup.bash. This will setup the environment variable $ROS-DISTRO. Clone the repository into a ROS2 workspace (e.g. ~/ros2_ws/) and build the packages using colcon build from the Colcon Command Line Tools. To test the RCLC package run colcon test or if you have multiple repositories in this workspace colcon test --packages-select rclc. For correct installation of the rclc-package do a source ~/ros2_ws/install/local_setup.bash. Then you are ready to run the examples in the rclc_examples package.

The following repositories might not be in the default ROS 2 distribution: osrf_testing_tools_cpp and test_msgs. In this case install them manually:

 sudo apt-get install ros-$ROS_DISTRO-osrf-testing-tools-cpp
 sudo apt-get install ros-$ROS_DISTRO-test-msgs

License

rclc is open-sourced under the Apache-2.0 license. See the LICENSE file for details.

For a list of other open source components included in rclc, see the file 3rd-party-licenses.txt.

Quality assurance

  • Coding style:
    • The uncrustify tool is used to check the coding style.
  • Linters:
    • The cpplint tool is used to detect common flaws and problems in C/C++ code.
    • The cppcheck tool is used for code analysis.
    • The CMakeLists.txt is checked with lint_cmake and the package.xml with xmllint
  • Unit tests:

Known issues/limitations

Please notice the following issues/limitations:

  • The rclc executor is single-threaded. You cannot create nodes in multiple threads and manage the corresponding subscriptions/services/etc. by one executor.

Bloom Release Status of Code Repository ros2/rclc

Bloom release status of the packages in github.com/ros2/rclc/ for amd64 and arm64 architectures and ROS 2 distributions Foxy, Galactic, Humble and Rolling.

Package Release amd64 arm64
rclc Foxy Build Status Build Status
Humble Build Status Build Status
Iron Build Status Build Status
Rolling Build Status Build Status
rclc_examples
Foxy Build Status Build Status
Humble Build Status Build Status
Iron Build Status Build Status
Rolling Build Status Build Status
rclc_lifecycle
Foxy Build Status Build Status
Humble Build Status Build Status
Iron Build Status Build Status
Rolling Build Status Build Status
rclc_parameter
Humble Build Status Build Status
Iron Build Status Build Status
Rolling Build Status Build Status

Code coverage

The code coverage is tested with every commit, pull request. Results are available at codecov.

codecov

rclc's People

Contributors

acuadros95 avatar amfern avatar astralien3000 avatar bjsowa avatar borjaouterelo avatar carlossvg avatar cottsay avatar dirk-thomas avatar esteve avatar fujitatomoya avatar ivanpauno avatar jamoralp avatar janstaschulat avatar mergify[bot] avatar mwleeds avatar norro avatar nuclearsandwich avatar pablogs9 avatar qeyup avatar ralph-lange avatar ted-miller avatar wjwwood avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rclc's Issues

Foxy: backport of QoS API should be removed in rclc_parameters

The backported PR f246f1a
created a file in rclc_parameter package, even though the rclc_parameter package is not available in Foxy:
https://github.com/ros2/rclc/tree/foxy/rclc_parameter/src/rclc_parameter
(it now just contains one file)

I propose to delete the created file in rclc_parameter directory.

@pablogs9 we have to be more careful with backporting to Foxy as some features are not available there. Could you check if this backport created some other incompatabilities on Foxy?

ros2 build farm error Rolling

@norro
the ros2 build farm does not run for Rolling:

https://build.ros2.org/job/Rbin_uF64__rclc_lifecycle__ubuntu_focal_amd64__binary/44/console

23:06:13 /usr/lib/ccache/cc -DDEFAULT_RMW_IMPLEMENTATION=rmw_cyclonedds_cpp -DRCUTILS_ENABLE_FAULT_INJECTION -DROS_PACKAGE_NAME=\"rclc_lifecycle\" -Drclc_lifecycle_EXPORTS -I/tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/include -I/tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src -isystem /opt/ros/rolling/include  -g -O2 -fdebug-prefix-map=/tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC   -Wall -Wextra -Wpedantic -std=gnu99 -o CMakeFiles/rclc_lifecycle.dir/src/rclc_lifecycle/rclc_lifecycle.c.o   -c /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c
23:06:13 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c: In function โ€˜rclc_make_node_a_lifecycle_nodeโ€™:
23:06:13 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:50:5: warning: passing argument 9 of โ€˜rcl_lifecycle_state_machine_initโ€™ makes pointer from integer without a cast [-Wint-conversion]
23:06:13    50 |     true,
23:06:13       |     ^~~~
23:06:13       |     |
23:06:13       |     int
23:06:13 In file included from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/include/rclc_lifecycle/rclc_lifecycle.h:24,
23:06:13                  from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:17:
23:06:13 /opt/ros/rolling/include/rcl_lifecycle/rcl_lifecycle.h:253:49: note: expected โ€˜const rcl_lifecycle_state_machine_options_t *โ€™ {aka โ€˜const struct rcl_lifecycle_state_machine_options_t *โ€™} but argument is of type โ€˜intโ€™
23:06:13   253 |   const rcl_lifecycle_state_machine_options_t * state_machine_options);
23:06:13       |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
23:06:13 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:41:23: error: too many arguments to function โ€˜rcl_lifecycle_state_machine_initโ€™
23:06:13    41 |   rcl_ret_t rcl_ret = rcl_lifecycle_state_machine_init(
23:06:13       |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23:06:13 In file included from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/include/rclc_lifecycle/rclc_lifecycle.h:24,
23:06:13                  from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:17:
23:06:13 /opt/ros/rolling/include/rcl_lifecycle/rcl_lifecycle.h:244:1: note: declared here
23:06:13   244 | rcl_lifecycle_state_machine_init(
23:06:13       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23:06:13 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c: In function โ€˜rcl_lifecycle_node_finiโ€™:
23:06:13 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:233:13: error: too many arguments to function โ€˜rcl_lifecycle_state_machine_finiโ€™
23:06:13   233 |   rcl_ret = rcl_lifecycle_state_machine_fini(
23:06:13       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23:06:13 In file included from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/include/rclc_lifecycle/rclc_lifecycle.h:24,
23:06:13                  from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:17:
23:06:13 /opt/ros/rolling/include/rcl_lifecycle/rcl_lifecycle.h:278:1: note: declared here
23:06:13   278 | rcl_lifecycle_state_machine_fini(

https://build.ros2.org/job/Rbin_ufv8_uFv8__rclc_lifecycle__ubuntu_focal_arm64__binary/39/

23:05:57 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:50:5: warning: passing argument 9 of โ€˜rcl_lifecycle_state_machine_initโ€™ makes pointer from integer without a cast [-Wint-conversion]
23:05:57    50 |     true,
23:05:57       |     ^~~~
23:05:57       |     |
23:05:57       |     int
23:05:57 In file included from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/include/rclc_lifecycle/rclc_lifecycle.h:24,
23:05:57                  from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:17:
23:05:57 /opt/ros/rolling/include/rcl_lifecycle/rcl_lifecycle.h:253:49: note: expected โ€˜const rcl_lifecycle_state_machine_options_t *โ€™ {aka โ€˜const struct rcl_lifecycle_state_machine_options_t *โ€™} but argument is of type โ€˜intโ€™
23:05:57   253 |   const rcl_lifecycle_state_machine_options_t * state_machine_options);
23:05:57       |   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
23:05:57 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:41:23: error: too many arguments to function โ€˜rcl_lifecycle_state_machine_initโ€™
23:05:57    41 |   rcl_ret_t rcl_ret = rcl_lifecycle_state_machine_init(
23:05:57       |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23:05:57 In file included from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/include/rclc_lifecycle/rclc_lifecycle.h:24,
23:05:57                  from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:17:
23:05:57 /opt/ros/rolling/include/rcl_lifecycle/rcl_lifecycle.h:244:1: note: declared here
23:05:57   244 | rcl_lifecycle_state_machine_init(
23:05:57       | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23:05:57 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c: In function โ€˜rcl_lifecycle_node_finiโ€™:
23:05:57 /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:233:13: error: too many arguments to function โ€˜rcl_lifecycle_state_machine_finiโ€™
23:05:57   233 |   rcl_ret = rcl_lifecycle_state_machine_fini(
23:05:57       |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23:05:57 In file included from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/include/rclc_lifecycle/rclc_lifecycle.h:24,
23:05:57                  from /tmp/binarydeb/ros-rolling-rclc-lifecycle-1.0.0/src/rclc_lifecycle/rclc_lifecycle.c:17:
23:05:57 /opt/ros/rolling/include/rcl_lifecycle/rcl_lifecycle.h:278:1: note: declared here
23:05:57   278 | rcl_lifecycle_state_machine_fini(

CI run

Running the current master branch with ROS2 master branches on CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • macOS Build Status
  • Windows Build Status

correct rosdistro build for dashing

update bloom release for dashing.
Problem:

  • branch foxy is used for Dashing bloom release.
  • new pull requests on Foxy trigger a build on Dashing, which is EOL.

Solution:

  • created a Dashing branch (copy from Foxy)
  • change bloom release configuration to use dashing instead of foxy branch

Refactoring handle types

Initally, we only had services, subscriptions, clients. Now we have multiple types of callbacks for subscriptions, services and clients:

  • with request id/without request id (for services/clients),
  • with context, without context (for subscriptions/clients/services).

It would make sense to refactor handle->type and add e..g
SERVICE_WITH_REQ_ID
SERVICE_WITHOUT_REQ_ID
SERVICE_WITHOUT_CONTEXT
SERVICE_WITH_CONTEXT
SUBSCRIPTION_WITH_CONTEXT
SUBSCRIPTION_WITHOUT_CONTEXT
same for CLIENTS ...
(quite a number of types ...)

the request-id is currently not used in services with context.

@norro @pablogs9 @BrettRD Let's discuss here, how to simplify callback-type and handle-type variables.

Server crashing after ros2 cli service call

Issue template

  • Hardware description: Ubuntu LTS vm
  • Installation type: from source
  • Version or commit hash: master (59632f2)

Steps to reproduce the issue

  1. Start example server - ros2 run rclc_examples example_service_node
  2. Perform a ROS 2 CLI service call - ros2 service call /addtwoints example_interfaces/srv/AddTwoInts "{a:24, b:42}"

Expected behavior

Expected: you can perform the service call multiple times. This is still true, if you use ros2 run rclc_examples example_client_node instead of the CLI service call.

Actual behavior

example_service_node exits within 2-3 seconds.

Additional information

When I edit the example_service_node to print the rcl error:

77:  rcl_ret_t rc = rclc_executor_spin(&executor):
78:  printf("%d: %s", rc, rcl_get_error_string().str);

I get the following error printed 2-3 seconds aftre the CLI service call:
601: rclc_executor_spin_some error, at [snip]/src/rclc/executor.c:1347

Question about best-effort publisher thread safety

I'm using a best-effort publisher in a fast loop, The non-blocking behaviour is great but I'm finding duplicate messages where the message was re-written by the data source before the publish completed.

The best-practices solution is multiple-buffering, where a pool of messages gets circulated through the data-writer and publisher, but I don't have any way of telling the pool when the message has been released by the publisher and can be re-used by the writer.

A callback (with a user-context pointer, released-message pointer, and optionally a rcl_ret_t return value) is an option, but might be overkill.

Allow passing context to subscription callbacks

Following from #35 add context pointers to service calls, I'd like to use subscriptions with context pointers too

The change would re-use (and re-name) the void * service_context; added in #45, and add the following:

typedef void (* rclc_subscription_callback_with_context_t)(const void *, void *);
rcl_ret_t
rclc_executor_add_subscription_with_context(
  rclc_executor_t * executor,
  rcl_subscription_t * subscription,
  void * msg,
  rclc_callback_t callback,
  void * context,
  rclc_executor_handle_invocation_t invocation);

I have most of a patch, I'll re-base it onto #45 in the next couple of weeks and submit a pull to micro-ros

rclc_executor_spin allows only one service call

When executing the example service node, spinning by a calling of rclc_executor_spin (example_service_node.c#L77), just one service call is processed, then the process closes.

Steps to reproduce:

  1. Start the example_service_node executable from rclc_example
  2. Call the example service, e.g., on the terminal with ros2 service call /addtwoints example_interfaces/srv/AddTwoInts "{a: 17, b: 42}"
  3. Call the example service again

Expected behavior:
Service remains active after the first service call, accepting further service calls.

Observed behavior:
Example service executable closes after (successfully) handling the first service call.

API for removing a subscription

There is no API for removing subscription, timers, services or clients. I ran into this while trying to add a context pointer to subscriptions.

rclc_executor_add_subscription increments executor->index after filling executor->handles[executor->index] with the information about the subscription.

During rclc_executor_spin_some, the executor iterates through all handles and makes a call to rcl_wait_set_add_subscription, then calls rcl_wait

If you call rcl_subscription_fini on the subscription, The RCL docs indicate After calling, calls to rcl_wait and rcl_take will fail when using this subscription.

No call in executor.c is able to decrement executor->index or remove a handle containing an invalid subscription.
Once you call rcl_subscription_fini, the executor breaks permanently.

I'd like to propose an API addition of:
rcl_ret_t rclc_executor_remove_subscription(rclc_executor_t * executor, rcl_subscription_t * subscription);
and similar for clients, timers and services.

This would search through executor->handles until it finds a pointer match to the subscription argument, remove it, and shorten the handles list.
I can't see a safe way of making this automatically detect dead subscriptions, especially in my case where my rcl_subscription_t are allocated dynamically.

Is the order of handles important?

[rclc] Implementation of "client with context" should be improved

Missing condition to call client callback with context:

@norro. It looks like that the implementation of the client callback with context is not properly called: In case the client would have a context (which is not possible now), it will call the normal callback function and not the callback function with context:

handle->client_callback(handle->data);

You never use a client callback with context?

Create bloom release for Foxy, Galactic, Rolling

Create bloom release for Foxy, Galactic and Rolling once the open PR/issues

are merged/resolved.

TODO:

  • update changelog for Rolling
  • update changelog for Galactic
  • update changelog for Foxy
  • create tag for Rolling
  • create tag for Galactic
  • create tag for Foxy
  • create bloom release Rolling
  • create bloom release Galactic
  • create bloom release Foxy
  • check that all bloom releases pass ROS 2 build farm (build fails for rclc_parameters, see PR #156)
  • update README (bloom release status table)

Notes:

  • do it in this order: foxy, galactic, rolling (otherwise the bloom release tool will complain that rolling has a newer tag than foxy)

Create bloom release (windows support)

new features

  • windows port
  • new API for rcl_lifecycle in Rolling
  • operating-system independent sleep functions
  • minor bug fixes

TODO:

  • bloom release for Rolling
  • bloom release for Dashing
  • bloom release for Foxy

Create bloom release for Galactic and Rolling to resolve test dependencies in 'rclc_parameters'

@pablogs9 The package rclc_parameters had missing test dependencies. While the build at ROS 2 build farm on the pull requests were successful, the creation of debian packages (bloom release) were not because test dependencies are evaluted seperately for each package.

This was fixed in PR: #156.

Status:

Galactic:

  • update changelog and version
  • create tag 2.0.3
  • create PR on rosdistro
  • check bloom release status
  • create github release v2.0.3-galactic

Rolling:

  • update changelog and version
  • create tag 3.0.3
  • create PR on rosdistro
  • check bloom release status
  • create github release v3.0.3-rolling

rclc_parameters - cmake version too low

@pablogs9 The build of rclc_parameters on Ubuntu 18.04 on Galactic fails with:

...
Starting >>> rclc_parameter
--- stderr: rclc_parameter                                                                     
CMake Error at CMakeLists.txt:8 (add_compile_definitions):
  Unknown CMake command "add_compile_definitions".
---
Failed   <<< rclc_parameter [0.17s, exited with code 1]
Aborted  <<< rclc_lifecycle [0.35s] 

Required cmake version in CMakeLists.txt is 3.5. My locally installed cmake has version 3.10.2. add_compile_definitions are supported from version 3.12

This is the line in CMakeLists.txt:

add_compile_definitions(RCLC_PARAMETER_MAX_STRING_LENGHT=${RCLC_PARAMETER_MAX_STRING_LENGHT})

As an alternative, you could use add_definitions like in rclc\CMakeLists.txt:

if("${rcl_VERSION}" VERSION_LESS "1.0.0")
  message(STATUS "Found rcl version ${rcl_VERSION}, which belongs to Dashing or Eloquent")
  # Later, with CMake 3.12+ use:
  # add_compile_definitions(USE_RCL_WAIT_SET_IS_VALID_BACKPORT)
  add_definitions(-DUSE_RCL_WAIT_SET_IS_VALID_BACKPORT)
else()
  message(STATUS "Found rcl version ${rcl_VERSION}, which belongs to Foxy or later")
  find_package(rosidl_runtime_c REQUIRED)
endif()

Could you check, how to replace add_compile_definitions? The build jobs at github and openrobotics build farm run successfully, as I guess ubunto 20.04 is used with a more recent version of cmake.

Alternative: you have to increase the minimum required version of cmake in CMakeLists.txt. But then users on Ubuntu 18.04 will have to update cmake manually first...

Allow passing context to service callbacks

Currently, service callbacks get

  1. either exactly two arguments: pointer to the request and pointer to the response
  2. or three arguments: pointer to the request, pointer to the response, and the request id

This is rather limiting, as it does not allow to provide any additional context to the callback. E.g., in case of the lifecycle node: when the state change service is called, I currently don't have the possibility to get the lifecycle node on which the state change was called.

I propose to add a third option, in addition to the two introduced above, where a third void * argument allows passing additional context, e.g., the lifecycle node in the example above.

Provide system tests (lauch_test)

Provide launch tests for system tests to test, e.g., interplay between publisher/subscriber, server/client, parametrization of nodes, etc.

Should be in a separate package as it introduces additional dependencies, e.g., to launch, launch_test, and rclcpp.

rclc_parameter: failing unit test on Rolling

@pablogs9
The github CI build job on Rolling fails:
https://github.com/ros2/rclc/actions/runs/1036566413

This is the output of colcon_test --packages-select rclc rclc_lifecycle rclc_parameter on my local machine on Rolling:

1: -- run_test.py: invoking following command in '/home/jst3si/github/build/rclc_parameter':
1:  - /home/jst3si/github/build/rclc_parameter/rclc_parameter_test --gtest_output=xml:/home/jst3si/github/build/rclc_parameter/test_results/rclc_parameter/rclc_parameter_test.gtest.xml
1: Running main() from /home/jst3si/ros2_rolling/install/gtest_vendor/src/gtest_vendor/src/gtest_main.cc
1: [==========] Running 1 test from 1 test suite.
1: [----------] Global test environment set-up.
1: [----------] 1 test from Test
1: [ RUN      ] Test.rclc_node_init_default
1: 1626428338.597294 [0] rclc_param: using network interface wlp4s0 (udp/192.168.2.113) selected arbitrarily from: wlp4s0, br-b36361797d8d, br-14891b21ebd2, br-25a8035deb43, br-3a336396c85a, br-4785f765189b, br-89d99fc843c8, br-9b72c4be763f, br-adc9c608f11a, docker0, br-011ba5ddf9ec, br-1fa8df27d324, br-6bd062b25b91, br-5c6374d44867, br-815016a75d18, br-919ec2a858fb, br-997bb5b6c865, br-bcd6b201b56c, br-18ed396621d3, br-2e319e5f5bdf, br-89bec585106e, br-cf4299774085, br-de0a63c0f8fd, tun0
1: 
1: >>> [rcutils|error_handling.c:108] rcutils_set_error_state()
1: This error state is being overwritten:
1: 
1:   'parameter is a null pointer, at /home/jst3si/github/src/rclc/rclc_parameter/src/rclc_parameter/parameter_server.c:235'
1: 
1: with this new error message:
1: 
1:   'node is a null pointer, at /home/jst3si/github/src/rclc/rclc_parameter/src/rclc_parameter/parameter_server.c:237'
1: 
1: rcutils_reset_error() should be called after error handling to avoid this.
1: <<<
1: rclc_parameter_test: /home/jst3si/ros2_rolling/src/ros2/rmw_cyclonedds/rmw_cyclonedds_cpp/src/TypeSupport2.hpp:405: virtual rmw_cyclonedds_cpp::TypedSpan<const char> rmw_cyclonedds_cpp::ROSIDLC_StringValueType::data(const void*) const: Assertion `str->capacity == str->size + 1' failed.
1: -- run_test.py: return code -6            
1: -- run_test.py: generate result file '/home/jst3si/github/build/rclc_parameter/test_results/rclc_parameter/rclc_parameter_test.gtest.xml' with failed test
1: -- run_test.py: verify result file '/home/jst3si/github/build/rclc_parameter/test_results/rclc_parameter/rclc_parameter_test.gtest.xml'
1/6 Test #1: rclc_parameter_test ..............***Failed    0.40 sec
...
83% tests passed, 1 tests failed out of 6

Label Time Summary:
cppcheck      =   0.62 sec*proc (1 test)
cpplint       =   0.76 sec*proc (1 test)
gtest         =   0.40 sec*proc (1 test)
lint_cmake    =   0.47 sec*proc (1 test)
linter        =   3.51 sec*proc (5 tests)
uncrustify    =   0.60 sec*proc (1 test)
xmllint       =   1.06 sec*proc (1 test)

Total Test time (real) =   3.91 sec

The following tests FAILED:
	  1 - rclc_parameter_test (Failed)
Errors while running CTest
--- stderr: rclc_parameter
Errors while running CTest
---
Finished <<< rclc_parameter [4.09s]	[ with test failures ]

Summary: 3 packages finished [23.8s]
  1 package had stderr output: rclc_parameter
  1 package had test failures: rclc_parameter

Maybe this has something to do with the recent PR regarding set_compile_definition macro in CMakeLists.txt?

Remove unecessary codecov token from repository secrets.

I've been reviewing ROS-related repositories which use Codecov after the security incident announced yesterday. This repository uses the Codecov GitHub action and so was affected by the issue. The only secret exposed in the action is the configured codecov token and since the secret is not actually required I think the best course of action is to regenerate the codecov secret and remove it from the repository. I'm happy to take both operations but I wanted to notify the maintainers of the repository before doing so.

Versions of the codecov action >= 1.4.0 will now perform a checksum check of the bash script used internally to push data to codecov. Since this repository is using the action @v1 future actions runs will use an appropriate version of the codecov action.

- uses: codecov/codecov-action@v1

Feature request: C++ support

We have received a number of requests to provide a C++ API for micro-ROS. Therefore we would like to discuss how to develop a C++ API for micro-ROS as a community effort. The default rclcpp API uses dynamic memory allocation (STL containers) which is problematic for micro-controllers due to memory framentation and potentially allocating more memory than available. Completely re-writing rclcpp would be a large effort, therefore we see two basic strategies:

  • A) a replacement of rclcpp with a minimal feature set without dynamic memory allocation
  • B) thin C++ layer on top of rclc.

The decision might also depend on the requirements for such a C++ API. So please feel free to join the next EWG meeting on 27th July 2021 to share your opinion:
https://discourse.ros.org/t/ros-2-embedded-wg-meetings/15460

You are also welcome to comment here below.

RCCHECK

Suggestion:
Make the current RCCHECK macro(s) (see here for example) part of rclc library, e.g., as RCCHECK/RCLCCHECK/RCLC_CHECK macro.

Rationale:
I end up introducing the same code again and again in almost all of my rclc files as well.

Support for lifecycle

Add support for rclc lifecycle nodes, i.e., bundle ROS 2 default state machine with nodes, enable transition callbacks, etc.

Service call is processed twice

In an rclc application of mine, but also in the example service node (when applying this fix), I see that the service is processed twice. I do not have the appropriate rcl(c) knowledge / debugging abilities to understand the source of this issue.

Steps to reproduce:

  1. Apply this fix to the example service node
  2. Execute the example service node
  3. Call the service once, e.g., with ros2 service call /addtwoints example_interfaces/srv/AddTwoInts "{a: 17, b: 42}"

Expected output of the example service node:

Service request value: 17 + 42

Observed output of the example service node:

Service request value: 17 + 42
Service request value: 17 + 42

Provide a interface to initialize the executors memory before spinning

As a user of rclc, I'd like to be able to initialize all memory the executor will need before going into my "active" mode. Right now, this is done on the first spin. My current workaround is to call spin_some with a timeout of 0 at the end of my initialization. However, this is not fully transparent. "Why do you spin here?"

Feature request: Logging like ros2 node.get_logger()

A ROS2 node provides a handy interface for log messages. Something like node.get_logger().info(). You all know we can view these messages in rqt and other tools.

It seems that such a function is not availabe in micro-ros

BR Patrick

see previous ticket: micro-ROS#77
see also: micro-ROS#75
@PaddyCube We are transferring all tickets/PR to ros2/rclc repository. The micro-ros organization shall only be used for feature branches based on ros2/rclc. That's why I created this ticket on ros2/rclc and closed your ticket on micro-ros/rclc.

Build error on Rolling

  • Hardware description: Ubuntu 20.04, ROS2 Rolling
  • Installation type: micro-ROS Arduino installed from sources
  • Version or commit hash: micro-ROS Arduino from Rolling branch (main)

Steps to reproduce the issue

Hello,
I tried to build the latest version from micro-ROS Arduino, but a build error occurred:

cd ~/Arduino/libraries
git clone -b main https://github.com/micro-ROS/micro_ros_arduino.git
cd ~/Arduino/libraries/micro_ros_arduino
sudo docker pull microros/micro_ros_arduino_builder:rolling
sudo docker run -it --rm -v $(pwd):/arduino_project microros/micro_ros_arduino_builder:rolling -p teensy32

This last command failed:

Starting >>> rclc_lifecycle
--- stderr: rclc_lifecycle                                                                                                                                                                           
CMake Warning at /uros_ws/firmware/mcu_ws/install/share/rcutils/cmake/ament_cmake_export_libraries-extras.cmake:116 (message):
  Package 'rcutils' exports library 'dl' which couldn't be found
Call Stack (most recent call first):
  /uros_ws/firmware/mcu_ws/install/share/rcutils/cmake/rcutilsConfig.cmake:41 (include)
  /uros_ws/firmware/mcu_ws/install/share/rosidl_runtime_c/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /uros_ws/firmware/mcu_ws/install/share/rosidl_runtime_c/cmake/rosidl_runtime_cConfig.cmake:41 (include)
  /uros_ws/firmware/mcu_ws/install/share/lifecycle_msgs/cmake/ament_cmake_export_dependencies-extras.cmake:21 (find_package)
  /uros_ws/firmware/mcu_ws/install/share/lifecycle_msgs/cmake/lifecycle_msgsConfig.cmake:41 (include)
  CMakeLists.txt:11 (find_package)


/uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c: In function 'rclc_make_node_a_lifecycle_node':
/uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c:50:5: warning: passing argument 9 of 'rcl_lifecycle_state_machine_init' makes pointer from integer without a cast [-Wint-conversion]
     true,
     ^
In file included from /uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/include/rclc_lifecycle/rclc_lifecycle.h:24:0,
                 from /uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c:17:
/uros_ws/firmware/mcu_ws/install/include/rcl_lifecycle/rcl_lifecycle.h:244:1: note: expected 'const rcl_lifecycle_state_machine_options_t * {aka const struct rcl_lifecycle_state_machine_options_t *}' but argument is of type 'int'
 rcl_lifecycle_state_machine_init(
 ^
/uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c:41:23: error: too many arguments to function 'rcl_lifecycle_state_machine_init'
   rcl_ret_t rcl_ret = rcl_lifecycle_state_machine_init(
                       ^
In file included from /uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/include/rclc_lifecycle/rclc_lifecycle.h:24:0,
                 from /uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c:17:
/uros_ws/firmware/mcu_ws/install/include/rcl_lifecycle/rcl_lifecycle.h:244:1: note: declared here
 rcl_lifecycle_state_machine_init(
 ^
/uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c: In function 'rcl_lifecycle_node_fini':
/uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c:233:13: error: too many arguments to function 'rcl_lifecycle_state_machine_fini'
   rcl_ret = rcl_lifecycle_state_machine_fini(
             ^
In file included from /uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/include/rclc_lifecycle/rclc_lifecycle.h:24:0,
                 from /uros_ws/firmware/mcu_ws/uros/rclc/rclc_lifecycle/src/rclc_lifecycle/rclc_lifecycle.c:17:
/uros_ws/firmware/mcu_ws/install/include/rcl_lifecycle/rcl_lifecycle.h:278:1: note: declared here
 rcl_lifecycle_state_machine_fini(
 ^
make[2]: *** [CMakeFiles/rclc_lifecycle.dir/build.make:66: CMakeFiles/rclc_lifecycle.dir/src/rclc_lifecycle/rclc_lifecycle.c.obj] Error 1
make[1]: *** [CMakeFiles/Makefile2:108: CMakeFiles/rclc_lifecycle.dir/all] Error 2
make: *** [Makefile:144: all] Error 2
---
Failed   <<< rclc_lifecycle [1.12s, exited with code 2]

Additional information

@pablogs9 gave me the following information:
this is an RCLC problem because they have not updated their RCL API usage in Rolling. These are the changes: ros2/rcl@e9b588d

Release rclc for Galactic

Galactic branch for ROS 2 was created: https://discourse.ros.org/t/galactic-api-and-feature-freeze-in-rolling/19795

TODO:

  • create new branch for Galactic
  • new CI job for Rolling
  • update CI jobs (Rolling stays the same)
  • new bloom release for Galactic
  • update codecov badge in README.md

@norro, @ralph-lange @pablogs9 ,@BrettRD

Which PR shall me merge for the Galactic release?

currently open PRs for Rolling:

  • Add parameter server functionality: #88
  • Quality declaration statement #74
  • Add Subscription with context pointer #73 (closed)
  • Provide lifecycle services in the rclc lifecycle nodes #51

Status of rclc?

Hello!

I'm really looking forward to ROS2's C API and was wondering what the current status of the project is? What's the best way to stay up to date in the future?
Thanks!

rclc_executor_trigger_one way out of date

I'm working #116 and I'm not sure what to do with rclc_executor_trigger_one.

This looks like it's supposed to return true if at least one of handles is ready to be executed, but it returns false if it reaches a type in CLIENT, SERVICE, or GUARD_CONDITION

For now I'm expanding it to any type where data_available is ever set to true

If anyone knows what this is, can we discuss a test for it?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.