Commit graph

554 commits

Author SHA1 Message Date
William Woodall
39c22c8508
typo (#502) 2018-06-19 12:43:06 -07:00
William Woodall
62c8c5b762 executor could take more than once incorrectly (#383)
* Baseline test and force threads to yield.

* Add timer tracking for executor.

* Add locking and test happy-path exit conditions.

* Move logic to multi_threaded_executor

* Address reviewer feedback by reducing scope of set.

* Expand tolerance on testing.

* comment fixup

Otherwise it seemed to me like it would yield twice.
2018-06-18 22:46:28 -05:00
Karsten Knese
ec17d68b41
*_raw function (#388)
* publish_raw function

* subscription traits

* listener raw

* rebased

* cleanup and linters

* explicit test for deleter in unique_ptr

* add missing copyright

* cleanup

* add rmw_serialize functions

* linters

* explicit differentiation between take and take_raw

* cleanup debug messages

* rename to rmw_message_init`

* address comments

* address review comments

* raw->serialized

* use size_t (#497)
2018-06-16 10:36:00 +02:00
William Woodall
1556b6edf4
always get service name from rcl to account for remapping (#498) 2018-06-14 21:42:00 -07:00
Shane Loretz
9b294ec720
Get parameters that aren't set (#493)
* Document get_parameters()

* Return NOT_SET params in get params service
2018-06-06 10:23:42 -07:00
Shane Loretz
84c8d58612
Pass initial parameter values to node constructor (#486)
* Pass parameter values to node constructor
2018-06-05 15:29:20 -07:00
Shane Loretz
8f793fdb4a
Convert rcl_params_t to ParameterMap (#485)
Convert from rcl_params_t to map of node parameters

Adds rclcpp::parameter_map_from(const rcl_params_t * const)
Adds rclcpp::parameter_value_from(const rcl_variant_t * const)
Adds dependency on rcl_yaml_param_parser
2018-06-05 10:54:08 -07:00
Shane Loretz
d298fa4445
Split ParameterVariant into Parameter and ParameterValue (#481)
* Split ParametrVariant into Parameter and ParameterValue
* Test expects ParameterTypeException
* get_parameter_value() -> get_value_message()
* Make to_parameter() const and rename to to_parameter_msg()
2018-06-01 11:48:56 -07:00
Esteve Fernandez
97575fd59b Relax template matching rules for std::bind and GNU C++ >= 7.1 (#484)
* Relax template matching rules for std::bind and GNU C++ >= 7.1

* Document reason test was added
2018-06-01 13:28:45 -04:00
Ernesto Corbellini
d6057270f2 Use rosgraph_msgs/Clock for /clock topic. (#474)
* Use rosgraph_msgs/Clock for /clock topic.

* Update the test cases.
2018-05-31 01:32:08 +02:00
Shane Loretz
d82ce9666c
Autostart parameter services (#478)
* Autostart parameter services
* Add bool start_parameter_services
2018-05-25 13:07:59 -07:00
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
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
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
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
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
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
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
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
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
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
William Woodall
eed5999221
small doc touchup (#400) 2017-11-17 16:06:06 -08:00
Tully Foote
a215d2d22e
update rclcpp to use the refactored TimeSource Clock logic (#371)
This implements a TimeSource in rclcpp, adds the Clock class.
2017-11-16 17:26:56 -08:00
dhood
24f39700c6
Implement rclcpp-specific logging macros [taking name not object] (#389) 2017-11-15 14:14:09 -08:00
G.A. vd. Hoorn
70d2b4b739 macros: fix two minor typos in doxygen. (#386) 2017-10-13 12:08:10 -07:00
Karsten Knese
022b2b1b80 sync parameter takes optional remote node name (#380) 2017-10-02 11:46:00 -07:00
Dirk Thomas
acd231abab remove obsolete INDENT-OFF usage 2017-09-29 10:34:52 -07:00
Dirk Thomas
38c750b876 update style to match latest uncrustify 2017-09-28 15:38:40 -07:00
Shane Loretz
e1f4568bc7 Fix static assertion on xcode 9 (#379)
* Change allocator type to match map key
2017-09-27 19:09:20 -07:00
William Woodall
ca5fb57126 Improvements to rclcpp::Time (#375)
* enable Time to be trivially constructible

This is required to use it in a Qt Signal/Slot.

* operator= should return T &

See: https://stackoverflow.com/questions/9072169/why-should-the-assignment-operator-return-a-reference-to-the-object

* add operator!=
2017-09-19 08:32:10 -07:00
Karsten Knese
1c42a75f43 parameter client takes node interfaces (#368)
* parameter client takes node interfaces

* correct wrong copy paste

* correctly fetch node name

* use node_topics_interface for creating parameter event

* fix typos
2017-09-05 15:04:36 -07:00
Karsten Knese
8e2e64e82a freeing Time members in destructor, adding copy constructor / assignment operator (#362)
* copy constructor for fixing windows debug

* remove debug prints

* style

* correctly free resources in destructor

* correct copy and assignment operators

* explicit call to copy constructor
2017-08-24 15:21:01 -07:00
Dirk Thomas
688c83a44c expose rcl handles 2017-08-23 14:29:37 -07:00
dhood
124500511b Add wait_for_service and service_is_ready for SyncParametersClient (#356) 2017-08-16 22:28:53 -07:00
Chris Lalancette
cd839663b4 Fix memory leaks in rclcpp (#354)
* Make sure to delete service_handle when in the Service() destructor.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>

* Make sure to delete the allocated rcl_node on error paths.

This all happens *before* we setup the shared_ptr destructor,
so we have to hand delete in the error paths.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>

* Move delete rcl_node up.

It turns out that we are always going to throw in that block,
and we never access rcl_node, so just delete it very early
on.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
2017-08-11 05:45:25 -07:00