Commit graph

799 commits

Author SHA1 Message Date
Karsten Knese
c25d227ce9
remove const qualifier for transition states (#197)
* remove const qualifier for transition states

* remove unnecessary const_casts

* init and fini function for state and transition
2017-12-05 20:22:19 -08:00
Hunter Allen
77e6979d9f Add allocator parameter to rcl_X_is_valid functions (#180)
* Add allocator parameter to rcl_client_is_valid.

* Add allocator parameter to rcl_publisher_is_valid.

* Add allocator parameter to rcl_subscription_is_valid.

* Add allocator parameter to rcl_service_is_valid.

* Satisfy linter, and make error messages more consistent.

* Add calls to allocator check.

* Fixed macro calls.

* Change parameter name for clarity.

* Updated header parameter names.

* Resolve merge conflict after rebase.

* Address comments by @mikaelarguedas

* Linting

* add missing checks and homogenize error message

* non const allocator

* 'error msg allocator is invalid' -> 'allocator is invalid'

* missed one const

* cast to remove const without warnings
2017-12-04 14:35:29 -08:00
Dirk Thomas
8ce42c6768
Merge pull request #196 from ros2/check_if_test_exists_before_adding_properties
check if test exists before adding properties
2017-12-03 13:05:23 -08:00
Dirk Thomas
91fb0279b8 check if test exists before adding properties 2017-12-02 20:11:19 -08:00
Mikael Arguedas
d91af42f93
cmake 3.10 compatibility: pass absolute path to file(GENERATE) function (#195)
* cmake 3.10 compatibility: pass absolute path to file(GENERATE) function

* passing the right path to add_test is useful too
2017-12-02 18:56:09 -08:00
Mikael Arguedas
80e500b771
Waitset member allocation use rmw types (#190)
* 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 *)
2017-11-28 15:01:22 -08:00
Mikael Arguedas
293aee7843
waitset -> wait_set (#191)
* waitset -> wait_set

* use wait set in doc
2017-11-27 13:30:11 -08:00
Mikael Arguedas
da4e5767c2
update service type support header name (#189) 2017-11-21 19:04:17 -08:00
dhood
7d0045adb8
Add debug logging (#187)
* 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
2017-11-21 17:23:50 -08:00
dhood
9f92f8fa37
Switch rcl_lifecyle to ament_cmake_ros (#186) 2017-11-20 14:41:25 -08:00
Mikael Arguedas
d811463b99
Timer tests2 (#165)
* add timer test

* more tests

* another one just for fun

* uncrustify
2017-11-17 18:21:12 -08:00
Ethan Gao
54d06f5654 Str mem leak rebased (#185)
* * 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>
2017-11-16 23:25:02 -08:00
Mikael Arguedas
b40eff9b9e
use RCUTILS_SAFE_FWRITE_TO_STDERR (#184)
* use RCUTILS_SAFE_FWRITE_TO_STDERR

* include-what-you-use and not rely on rcl/error_handling to provide this macro
2017-11-16 18:17:45 -08:00
Tully Foote
c4bc5aceb9 Remove duration clock type and duration init and fini as they're now just a struct with a single element.
Fix missed time_source -> clock rename

Resolve const violation warning.
2017-11-16 17:28:00 -08:00
Tully Foote
9f3bdbf99e Implement custom allocators for clock.
Store the allocator for the rcl_clock inside the datastructure to not require passing it into the fini.
2017-11-16 17:28:00 -08:00
Tully Foote
7b26e19900 remove usage of time point init and fini that are unnecessary now
switch rcl_time_point_get_now to be rcl_clock_get_now
2017-11-16 17:28:00 -08:00
Tully Foote
d273703e09 removing all references to default time sources
switching time_source to clock, and removing clock pointer from internal time_point and duration storage.
2017-11-16 17:28:00 -08:00
Ethan Gao
2079097227 optimize to avoid potential issue from uninitialized scalar variable (#183)
Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
2017-11-16 12:41:33 -08:00
jwang11
ddc172a7e6 expand rcl_node_is_valid with allocator to standarize the node check … (#173)
* 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
2017-11-15 18:42:07 -08:00
dhood
0ff5b98c3e
Remove error message when client take returns false (#182)
* Remove error msg from valid case

* Document RCL_RET_{CLIENT/SERVICE}_TAKE_FAILED
2017-11-15 12:10:09 -08:00
Tully Foote
40d899adfd clean up includes
include what you use and style fixups.
2017-11-15 11:32:14 -08:00
Tully Foote
091d58858a create a macro RCL_CHECK_ALLOCATOR to check the required methods are set on the allocator
Move to using RCUTILS macros under the hood.

Use new macro for instances of allocator check
2017-11-15 11:32:14 -08:00
Dirk Thomas
9aec08caba
Merge pull request #181 from ros2/ament_cmake_pytest
use ament_cmake_pytest instead of ament_cmake_nose
2017-11-13 17:35:11 -08:00
Dirk Thomas
d025db0fce use ament_cmake_pytest instead of ament_cmake_nose 2017-11-13 13:01:25 -08:00
Dirk Thomas
ebf6ea1a83
Merge pull request #177 from ros2/find_gtest_once
only find GTest once
2017-11-09 16:24:31 -08:00
Dirk Thomas
f1256645fb only find GTest once 2017-11-09 16:20:07 -08:00
Chris Lalancette
9f2010d6f3
rcutils_join_path now returns a char *. (#174)
So we no longer have to cast away the const when freeing the
memory.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
2017-11-09 09:01:59 -05:00
William Woodall
ffcfc34890
re-reduce scope of temp variable (#175)
follow up to #172
2017-11-08 08:16:42 -08:00
Ethan Gao
f7d7df6d69 Out-of-scope memory use and memory leak issue (#172)
* * 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>
2017-11-06 13:33:07 -08:00
Hunter Allen
2558923315 Implementing rcl_*_is_valid tests. (#166)
* 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
2017-10-26 18:56:20 -05:00
dhood
38d3725262 Add test for 0ns wait on triggered guard condition (#169) 2017-10-18 14:48:32 -07:00
Dirk Thomas
c6fe84ea54 Merge pull request #168 from ros2/remove_indent_off
remove obsolete INDENT-OFF usage
2017-09-29 14:24:18 -07:00
Dirk Thomas
29a01c3beb Merge pull request #167 from ros2/uncrustify_master
update style to match latest uncrustify
2017-09-29 11:12:38 -07:00
Dirk Thomas
54ed582ebe remove obsolete INDENT-OFF usage 2017-09-29 10:33:13 -07:00
Dirk Thomas
72bcb6b5b6 update style to match latest uncrustify 2017-09-28 15:27:22 -07:00
Dirk Thomas
ef94e9f277 0.0.3 2017-09-13 15:07:07 -07:00
Mikael Arguedas
1fa4acac8c Timer tests (#163)
* 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
2017-09-08 10:22:14 -07:00
Mikael Arguedas
cd8cff0024 remove todo that doesnt seem necessary anymore (#161) 2017-08-29 22:58:21 -07:00
Mikael Arguedas
173f1da229 add issue template 2017-08-14 18:04:24 -07:00
Dirk Thomas
ef61baa903 Merge pull request #159 from ros2/issue155
reset expected error msg to avoid warning
2017-08-11 15:14:20 -07:00
Dirk Thomas
ad044b509a reset expected error msg to avoid warning 2017-08-11 15:06:19 -07:00
Chris Lalancette
c1232a7288 Fix memory problems in rcl. (#158)
* 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>
2017-08-10 15:11:16 -07:00
Mikael Arguedas
cdedde8c91 Merge pull request #157 from ros2/rcl_use_rcutils
Rcl use rcutils
2017-08-10 12:12:11 -07:00
Mikael Arguedas
abf331e81f use snprintf from rcutils 2017-08-10 12:08:44 -07:00
Mikael Arguedas
835a90761c use macros 2017-08-10 12:08:18 -07:00
Karsten Knese
3cff9020d1 replace rcl_lifecycle_ret_t with lifecycle_msgs__TRANSITION__CALLBACK* (#153) 2017-08-02 14:05:03 -07:00
Karsten Knese
5cdef527de remove fprintf, use logging macros (#152)
* remove fprintf, use logging macros

* consistent includes
2017-07-27 07:55:26 -07:00
Mikael Arguedas
2d961fb501 Use _WIN32 everywhere (#151) 2017-07-24 14:49:26 -07:00
Hunter Allen
af03d0c44d Implement is valid methods (#103)
* 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.
2017-07-18 13:12:06 -07:00
Dirk Thomas
a57f66b54c 0.0.2 2017-06-30 15:11:46 -07:00