* expand rcl_node_is_valid with allocator to standarize the node check across RCL
Current RCL use very different way for node check in different components. Actually,
node.c already provide a standard way - rcl_node_is_valid. However, it just use
internal allocator, but some context has external allocator. The commit expand
rcl_node_is_valid with one more parameter for allocator. It can be used in all cases.
Signed-off-by: jwang <jing.j.wang@intel.com>
* Add allocator check in rcl_node_is_valid
* Separate argument checks from the concept of what makes a node invalid
* clarify allocator only used for error messages; default if NULL
* shorten parameter description
* * out-of-scope memory use and memory leak issue
temp going out of scope leaks the storage it points to
resource leak from local_namespace_
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* exclude the memory free when the namespace given is null
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* started implementing the publisher test
* Working on tests for services
* Add basic subscription test
* Add check for nullptr as service impl.
* Add client test
* Undid accidental removal of null topic test
* Made subscription test consistent with the others
* Addressed comments from @mikaelarguedas, as well as made things more uniform.
* Replace EXPECT_EQ(-, false) with EXPECT_FALSE(-) (and analogous), as well as fixed typo in comment.
* Added check for init's return value.
* Added RCL_PUBLIC to export dll targets.
* nit: homogenize docs
* dont return timeout errcode if we didnt hit user specified timeout
* update axisting test accordingly
* add timer test
* Revert "dont return timeout errcode if we didnt hit user specified timeout"
This reverts commit f44a93b8528e87ce46594af0d1184c116ade0cb4.
* alternative fix to not return timeout when timer is ready
this also fixes a bug where the wait would always return when all the
timers were canceled
fixes rclcpp#319
* fixups
* more tests
* another one just for fun
* remove new tests
* clearer variable name
* update comment
* Fix memory problems in rcl.
There are actually two problems here. In one of the problems,
we were sometimes taking an rcl_guard_condition that we did *not*
allocate, and trying to deallocate it. This was leading to
double frees.
The second problem was forgetting to call guard_condition_fini
during node_fini.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Drop duplicated check for overwriting previous error.
As pointed out by Dirk in review, the RCL_SET_ERROR_MSG
macro (through the rcutils_set_error_state() function)
already checks to see if a message is being dropped and
warns about it. Thus, we don't need to do it ourselves.
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
* Implemented service is valid check.
* Added an is-valid check for publishers.
* Changed the checks to the single call to
* Added subscription is_valid function, and replaced individual checks with a call to the function in the subscription code.
* Added documentation for is_valid functions.
* Moved the options pointer check into the is_valid function.
* Implemented client checks.
* use rcl_allocator for rcl_lifecycle
* correct return value interpretation
* fix unsigned comparison
* use namespace for lifecycle in-built topics
* linters
* Explicitly set C99 and C++14 via the CMake variables
* Enable passing CMAKE_C_STANDARD and CMAKE_CXX_STANDARD externally
* Use add_compile_options
* Be more specific about the compiler, independent from the OS
* Check compiler, not OS. Use add_compile_options instead of CMAKE_C_FLAGS and CMAKE_CXX_FLAGS
* add_compile_options() takes a list, not a string
* switch to c11 because of redefinition warnings
avoid typedef redifinition warning on macos
remove todo, compiler come from redefinition of typedef
* add functions to find certificates in filesystem
* only pass the security root path to the rmw
* remove unused code
* fix memory leak
* style
* memory leak round 2
* temporary ifdef for file permission flags
* _S_IREAD works only for file not directories
* use c_utililties functions
* add todo to use c_utility/concat rather that snprintf
* remove now unnecessary stat include
* use backslash separator for path on windows
* duh
* update c_utilities imports and functions signatures
* use c_utilities to concatenate paths
* print debug msg to stdout
* suppress warning, put sros env var as static at the beginnign of the file
* pass local namespace
* more c_utilities renaming
* comment out debug prints for now
* add env vars for security strategy and enforce them
* use rmw_node_security_options structure
* line length
* remove unused conditional
* rename environment variable
* style
* use defines for env var names and use rcutils_stringify on it
* remove unnecessary assignment
* consistent define naming for environment variables names
* stringify SECURITY_ROOST_DIRECTORY
* fix documentation of expand_topic_name()
* use expand_topic_name() in pub/sub/client/service
* update test expectations
* use absolute topic names to avoid mismatch due to expansion
* propagate new functions from rcutils error handling
* convert given rcl allocator to a rcutils allocator