* allocate memory for rmw types and not rcl types in waitset RMW storage
* zero initialize memory on resize and clear
* add missing void * cast to make windows happy
* set mem after checking successful alloc and use right type for rmw storage
* another instance of cast to (rmw_ ## Type ## _t *) instead of (void *)
* use ROS_PACKAGE_NAME in debug msgs
* rcl_lifecycle too
* Swap unnamed macros to named
* Remove semicolon
* Add debug logging
* Timer debug logging
* Wait debug
* A bit less wait debug...
* Clearer time output
* Remove the wait sublogger
* Use conditional logging instead of the else{}
* Add 'X finalized' msg
* Add send_response logging
* Remove extra semicolons
* Add publish/take messages
* [style nitpick] formatted variables on the next line
* * memory leak issues
address those memory leak issues with the API
rcutils_set_formatted_error which is defined
in rcutils
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* * Address those memory leak issues with new MACRO
add macro RCL_SET_ERROR_MSG_WITH_FORMAT_STRING which
is equals RCUTILS_SET_ERROR_MSG_WITH_FORMAT_STRING and
fix the memory leak issues with it
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* address uncrustify grumble
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
* 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.