Commit graph

946 commits

Author SHA1 Message Date
Tom Moore
15d505ec1f Adding parameter array support (#443)
* Adding parameter array support

* PR feedback

* Matching changes in upstream branch

* EXPECT_EQ takes expected value a first argument and actual as second
2018-05-10 16:05:52 -07:00
Michael Carroll
1be4d2d914
Fix bug when mixing shared_ptr and bind. (#470) 2018-05-04 13:10:47 -05:00
Shane Loretz
7cd8429534
Fini arguments passed to rcl_node_init() (#468)
* Fix memory leak in node_base
* Always free arguments
2018-05-01 12:59:15 -07:00
Mikael Arguedas
66a7c62531
update to rcutils logging in commented code as well (#466) 2018-04-27 15:31:08 -07:00
William Woodall
1610fc3973
pass AnyExecutable objects as reference to avoid memory allocation (#463)
* pass AnyExecutable objects as reference to avoid memory allocation

* remove style change
2018-04-17 21:54:42 -05:00
Shane Loretz
360f1b9425
Add CLI args to Node constructor (#461)
* Add CLI args to Node constructor

Adds arguments and use_global_arguments to NodeBase

* Check for integer overflow
2018-04-17 10:52:49 -07:00
Michael Carroll
07e5be7621
Correctly clean up arguments structure. (#459)
* Correctly clean up arguments structure.
* Use zero-initialized structure.
2018-04-11 12:43:18 -05:00
Dirk Thomas
45dcd0c6e5
handle node names which are null (#435) 2018-03-30 10:56:06 -07:00
Matthew
fa81d95e33 Add argument for thread count to multithreaded executor (#442) 2018-03-29 17:18:00 -07:00
Michael Carroll
ef17ec6248
Remove ros arguments (#454)
* Mark arguments vector as const.

* Add C++ version of rcl_remove_ros_arguments
2018-03-27 14:57:23 -07:00
Dirk Thomas
5f1fc660ea
change export order for static linking (#446) 2018-03-22 16:26:42 -07:00
jwang11
947e3f7e67 Fix time type issue in time unittest (#453)
Obviously it mean RCL_SYSTEM_TIME but not RCL_ROS_TIME in some test cases

Signed-off-by: jwang <jing.j.wang@intel.com>
2018-03-20 15:43:40 -07:00
William Woodall
9ce5aaa792
Revert "Revert "Store the subscriber, client, service and timer"" (#449)
* Revert "Revert "Store the subscriber, client, service and timer (#431)" (#448)"

This reverts commit 168d75cf1e.

* Convert all rcl_*_t types to shared pointers

Converts all rcl_*_t types in the memory allocation strategy to shared pointers to prevent crash happening when a subscriber is reset.

Issue: #349

* fixups
2018-03-19 21:05:26 -07:00
jwang
af6e86c522 Make rclcpp::Duration support scale operation
Duration scale is a convinient operation which had supported in ROS.
This commit make ROS2 support it.

Signed-off-by: jwang <jing.j.wang@intel.com>
2018-03-16 00:56:32 -07:00
William Woodall
d8abea55ec
make log location parameter const (#451) 2018-03-15 18:05:15 -07:00
William Woodall
168d75cf1e
Revert "Store the subscriber, client, service and timer (#431)" (#448)
This reverts commit 36526469c7.
2018-03-13 18:37:52 -07:00
Denise Eng
36526469c7 Store the subscriber, client, service and timer (#431)
* Convert all rcl_*_t types to shared pointers

Converts all rcl_*_t types in the memory allocation strategy to shared pointers to prevent crash happening when a subscriber is reset.

Issue: #349

* fixup! Convert all rcl_*_t types to shared pointers

* fix { use on function definitions

We always put the { on a new line for function definitions and class declarations.
2018-03-12 11:26:11 -07:00
Dirk Thomas
1a604b0c28
update style (#445) 2018-03-01 08:58:52 -08:00
Mikael Arguedas
2b7cb21cbd advise to ask questions on ROS answers 2018-02-26 22:01:36 -08:00
dhood
787de6ebf1
Get node's logger name from rcl (#433)
* Get logger name from rcl [direct]

* Get logger name from rcl [indirect]

* Update tests

* fixup on variable usage

* Move get_logger_name to NodeLogging interface
2018-02-26 14:36:10 -08:00
dhood
3786c91deb
Use ament_cmake_ros (#444)
* Control shared/static linking via BUILD_SHARED_LIBS

* Remove rmw dependency

* Add for rclcpp_lifecycle too

* exec depend on ament_cmake is for normalize_path
2018-02-26 09:46:44 -08:00
Guillaume Autran
0e79842b6b rclcpp logging still uses fprintf all over the place. (#439)
* rclcpp logging still uses fprintf all over the place.

Remove all printf log lines and replace with RCLUTILS_LOG_XXX macros.

Issue: #438

* fixup include order
2018-02-23 17:24:37 -08:00
William Woodall
f88ade7a2a
avoid using invalid iterator when erasing items using an iterator in a loop (#436)
* avoid using invalid iterator when erasing items using an iterator in a loop

* do not overwrite iterator in cases where it will be unused
2018-02-02 16:46:24 -08:00
serge-nikulin
3a503685bf change rcutils_time_point_value_t type from uint64_t to int64_t (#429)
* change rcutils_time_point_value_t type from uint64_t to int64_t

* small style changes

* fix test time datatype

* Update time primatives to int64_t

* change time primitive datatype to signed

* A few more instances of UL to L
2018-02-01 13:50:33 -08:00
Mikael Arguedas
e4b5c0bbb9
Byte array parameter rename (#428)
* rename bytes_value to byte_values

* adapt enum to new names

* rename byte_values to byte_array_values

* linters
2018-01-26 15:03:22 -08:00
jwang11
e08c80052a Move clear wait set from after rcl_wait to ahead (#427)
* Move clear wait set from after rcl_wait to ahead

Current code clear wait set after rcl_wait, it is not respond latency
friendly. In fact, clear wait set operation is not urgent, making sure it is
done before next rcl_wait should be fine.

Signed-off-by: jwang <jing.j.wang@intel.com>

* remove trailing whitespace
2018-01-18 18:49:52 -08:00
Ethan Gao
b81f55e5df Fix the dereference to NULL (#405)
* Fix the dereference to NULL
rmw_*_validation_result_string(validation_result) may return NULL,
and it's dereferenced by passing arg to NameValidationError

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>

* address NULL case of undefined type

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>

* Address the issue to deference to NULL with adapt
to the change of API rmw_*_validation_result_string

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>

* revise the typo

* throw exception when valid rmw check but invalid rcl check

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
2018-01-09 06:02:23 +11:00
Sriram Raghunathan
2bf688827b Change rmw_count_publishers API, to rcl equivalent rcl_count_publishe… (#425)
* Change rmw_count_publishers API, to rcl equivalent rcl_count_publishers and remove the TODO line.

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>

* Remove rmw_handle and refer to rcl_node_handle, change the API signature to topic_names.

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>

* Use rcl_* specific functions to derive the fully qualified topic name.

Signed-off-by: Sriram Raghunathan <rsriram7@visteon.com>

* [nitpick] remove unnecessary variable storage
2017-12-19 19:45:58 -08:00
Ethan Gao
199a26984d Fix the potential application crash issues (#426)
* err msg

* err msg

* Fix the potential application crash issues

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>

* minor tweak the code structure

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
2017-12-19 16:39:56 -05:00
Mikael Arguedas
bea1a52e24 0.4.0 2017-12-08 18:06:51 -08:00
Karsten Knese
3e0fa4be66
deallocate state and transition handles after call to fini (#424)
* deallocate state and transition handles after call to fini

* deallocate also when error occured
2017-12-06 17:26:18 -08:00
Karsten Knese
6d13bcb0fc
Fix 394 (#419)
* copy and assignment operator for state

copy and assignment operator for transition

remove unused const_casts

address comments

check for null in copy constructor

up

use init and fini functions from rcl

remove unused include

* explicitly zero initialize state and transitions

* add todo comment for follow up
2017-12-05 22:51:52 -08:00
Karsten Knese
c40f3c25c6
Fix 393 (#418)
* correctly copy state label

* correctly copy transition label

* uncrustify

* address comments

* up

* use init and fini functions from rcl
2017-12-05 20:22:57 -08:00
dhood
d823982f22
Allow logger to be passed into macros as a reference (#423)
* Remove reference for logger so it can be rclcpp::Logger &

This is the type when captured by reference in a lambda; windows can't
resolve it without.

* Wrap lines
2017-12-05 15:12:20 -08:00
dhood
6129a12df5
Remove namespaces and namespace escalation e.g. node:: (#416)
* Remove publisher:: namespace

* Remove subscription:: namespace

* Remove client:: namespace

* Remove service:: namespace

* Remove parameter_client:: namespace

* Remove parameter_service:: namespace

* Remove rate:: namespace

* Remove timer:: namespace

* Remove node:: namespace

* Remove any_service_callback:: namespace

* Remove any_subscription_callback:: namespace

* Remove event:: namespace

* Remove ContextSharedPtr escalation

Users can use the  directive themselves if they want

* Remove single_threaded_executor:: namespace

* Remove multi_threaded_executor:: namespace

* Remove context:: namespace

* node:: removal from new logger additions

* Fix linter issues that has been triggered with uncrustify

* Remove utilities:: namespace
2017-12-05 15:02:00 -08:00
Tully Foote
713ee8059c
Mirror clock API from Node to LifecycleNode (#417)
* Mirror clock API from Node to LifecycleNode

Follow up to #407

* adding headers for completeness
2017-12-05 00:25:28 -08:00
dhood
2e4e85f141
Add Logger class and give one to nodes (#411)
* Add Logger class and give one to nodes

* Try to improve compiler errors when non-Logger is passed to macros

* Add define for 'disabling' loggers

* Add/update tests

* Linter fix

* Documentation

* Windows fix

* Move free functions to source file (windows was upset)

* Fix windows by changing prototype ordering

* Store node logger in NodeBase

* Windows is not happy with this EXPECT_ANY_THROW

* Move get_logger to a NodeLogger interface

* Move Logger into 'logger' namespace

* Move helper function for macro errors into macro header

* Remove 'logger' namespace

* Return type on separate line

* Update copyright year

* Give lifecycle nodes a logger

* Add test for lifecycle node logger

Move the default_state_machine tests to another file because having
different test fixtures was causing init to be called twice.

* Switch to static_assert for logger check

* global ns scope in macro calls

just in case

* Revert "Add test for lifecycle node logger" (make diff smaller)

demos use the loggers and we don't test other node stuff in lifecycle_node

* Update for rcutils function name change

* Add reference to Node::get_logger() in doxygen

* Rename NodeLoggerInterface to NodeLoggingInterface
2017-12-04 16:07:29 -08:00
dhood
d989bd15c1
Prevent callback from being captured as a reference (#414) 2017-12-03 19:26:30 -08:00
dhood
bc47fa83dc
Rename severity_threshold -> level (#412) 2017-12-03 18:40:28 -08:00
dhood
8177771773
Allow creating parameter client from constructor of Node subclass (#413) 2017-12-03 17:12:43 -08:00
dhood
e9f0328ec8
Allow client to trigger another service call from its callback (#415) 2017-12-03 17:11:50 -08:00
Tully Foote
284dc17918
Add a clock interface to the Node API (#407)
node clock interface lower level abstraction
Update node and node interface to expose get_clock and now.
add unit tests to cover node clock API
2017-11-30 14:07:23 -08:00
dhood
3b06aa3721
Escalate more namespaces e.g. rclcpp::Service (#410) 2017-11-30 13:27:44 -08:00
Tully Foote
3426696541
provide a class to filter parameter events conveniently based on name and type of parameter event (#391)
adding test for parameter events filter
2017-11-29 11:11:18 -08:00
Mikael Arguedas
7bbf5f6e5b
waitset -> wait_set (#408)
* waitset -> wait_set

* cpplint

* use wait set in doc

* doc fixup
2017-11-27 13:30:07 -08:00
Tully Foote
5e64191e10
Resolve erase race condition. (#406)
Fixes #401

Extend time source tests to allocate and deallocate callback handlers.
2017-11-21 20:44:28 -08:00
Tully Foote
5e565c7e75
detach nodes from executors in destruction. (#404) 2017-11-21 11:42:44 -08:00
Hunter Allen
9be9d66da5
Remove const modifier to prevent compiler error for GCC 8. (#403) 2017-11-20 15:54:53 -05:00
Tully Foote
5c57de016f
work around windows failing debug test. Ticketing full debugging separately. (#402) 2017-11-19 20:09:41 -08:00
William Woodall
eed5999221
small doc touchup (#400) 2017-11-17 16:06:06 -08:00