Commit graph

367 commits

Author SHA1 Message Date
Dirk Thomas
16adb1e4f6
fix calculation of next timer call (#291)
* fix calculation of next timer call

* fix logic for period zero
2018-09-06 17:41:51 -07:00
Shane Loretz
e78e400018
Null deallocated jump callbacks (#294)
* Add failing test for add-remove-add callback

* Fix crash when adding callback after last was removed
2018-09-06 14:06:45 -07:00
Michael Carroll
f93072b1b8
Include namespaces in get_node_names. (#287) 2018-09-06 08:04:41 -05:00
Dirk Thomas
0e772b237e
fix naming of configure_error transition (#292) 2018-09-05 13:08:30 -07:00
William Woodall
7289d4a00a
Doc fixups (#288)
* remove vestigial parameter documentation

* fix parameter name typo

* small fixup
2018-08-31 18:32:27 -07:00
Shane Loretz
955c0c93da
Check if pointers are null before calling memset (#290) 2018-08-31 15:31:53 -07:00
Shane Loretz
ceff88b974
Clock has multiple time jump callbacks (#284)
* Clock has multiple time jump callbacks

Replaces pre_update and post_update
Adds callbacks when ROS time is activated or deactivated
Add rcl_clock_change_t, rcl_time_jump_t, rcl_jump_threshold_t
Add rcl_clock_add_jump_callback()
Add rcl_clock_remove_jump_callback()

* Fini generic clock after confirming correct clock type

* test_time no ASAN detections
2018-08-27 15:37:06 -07:00
Shane Loretz
ba9f24b852
consolidate wait set functions (#285)
* Consolidate functions to clear wait set

Add rcl_wait_set_clear()
Remove
  rcl_wait_set_clear_subscriptions()
  rcl_wait_set_clear_guard_conditions()
  rcl_wait_set_clear_clients()
  rcl_wait_set_clear_services()
  rcl_wait_set_clear_timers()

* Consolidate functions to resize wait set

Add rcl_wait_set_resize()
Removed
  rcl_wait_set_resize_subscriptions()
  rcl_wait_set_resize_guard_conditions()
  rcl_wait_set_resize_timers()
  rcl_wait_set_resize_clients()
  rcl_wait_set_resize_services()
2018-08-27 11:54:53 -07:00
Shane Loretz
3aebe9fbf9
ROS clock storage initially set to zero (#283) 2018-08-21 12:57:04 -07:00
Chris Ye
adc0190259 Fix deallocate issue of parameter_files (#279)
Correct pointer arithmetic on parameter_files to avoid deallocate memory out-of-bounds

Signed-off-by: Chris Ye <chris.ye@intel.com>
2018-08-16 11:21:28 -05:00
Chris Ye
696f62c80b Deallocate ret_val to avoid memery leak (#278)
In get_value() function ret_val is allocated from rcutils_strdup when type is DATA_TYPE_STRING,

Should be deallocate in switch val_type=DATA_TYPE_STRING case.

Signed-off-by: Chris Ye <chris.ye@intel.com>
2018-08-15 16:56:17 -05:00
Dirk Thomas
1e5bf4ac29
initialize memory before sending a message (#277)
* initialize memory before sending a message

* add todo referencing ticket

* wrap todo
2018-08-14 16:58:30 -07:00
dhood
e2f7c26123
Set error message when clock type is not ROS_TIME (#275) 2018-08-03 13:21:26 -07:00
dhood
3356bd4cf1
Copy allocator passed in to clock init (#274)
* Store allocator passed in to clock init

* Linter fix
2018-08-01 11:24:13 -07:00
Dirk Thomas
b324f9de0d
initialize timer with clock (#272)
* initialize timer with clock

* use rcl_clock_get_now

* call rcl_clock_fini at the end of each test

* modify rcl_clock_get_now to take a rcl_time_point_value_t

* update docblock

* update to pass time_point_value

* add check for NULL

* add rcl_timer_clock()

* fix style

* doc fixes

* fini clock
2018-07-27 18:28:02 -07:00
Mikael Arguedas
d3a734f266
use test_msgs instead of std_msgs in tests (#270) 2018-07-17 13:24:39 -07:00
dhood
c21a250a06 Add regression test for node:__ns remapping (#263)
* Add regression test for node:__ns remapping

* Fix node:=__ns remapping

* Finalize node in remap integration test
2018-07-16 15:18:23 -07:00
Dirk Thomas
0ed0581c44
remove use of uninitialized CMake var (#268) 2018-07-11 08:38:41 -07:00
Mikael Arguedas
16159adfc2
Uncrustify 0.67 (#266)
* fix indentation to comply with uncrusity 0.67

* fix spacing to comply with uncrusity 0.67
2018-07-11 08:31:06 -07:00
Mikael Arguedas
9a9762f175
Fix rosidl dependencies (#265)
* [rcl_lifecycle] remove rosidl deps as this package doesnt generate any messages

* depend on rosidl_generator_c
2018-07-05 13:01:12 -07:00
William Woodall
d13a902d9a 0.5.0 2018-06-25 14:38:04 -07:00
William Woodall
2f59759b0e fix version number for rcl_yaml_param_parser 2018-06-25 14:37:46 -07:00
William Woodall
aa4ac7d06c changelogs 2018-06-25 14:36:46 -07:00
dhood
c9fe312674
params -> ros__parameters 2018-06-18 21:37:16 -07:00
William Woodall
d63e2bc9cf
changes to support memory audit (#261)
* changes to rcutils_path_join()

* remove uses of malloc/realloc/calloc/free for allocator usage instead

* remove unused class members
2018-06-16 22:06:07 -07:00
William Woodall
ced49473db
Use private substitution in lifecycle topics and services (#260)
* use ~/<topic> rather than manually constructing topics/services

* use check argument for null macros
2018-06-16 18:36:58 -07:00
William Woodall
8f744520bd use rcutils_format_string() rather than malloc and rcutils_snprintf() (#240) 2018-06-16 13:47:51 -07:00
Karsten Knese
99c05cf3b4
*_raw function (#170)
* publish_raw function

* rcl_take_raw function

* comply to master

* add documentation

* use rcl_subscription_is_valid

* documentation fixups

* address review comments

* raw->serialized
2018-06-16 10:35:46 +02:00
Mikael Arguedas
bb6ea4c124
use test_msgs instead of example_interfaces (#259) 2018-06-13 18:29:58 +02:00
dhood
639916df70
Add regression test for connext 'wrong type writer' error (#257)
* Add regression test for connext 'wrong type writer' error

* Use osrf_testing_tools_cpp
2018-06-12 09:27:02 -07:00
dhood
6c785ffeb3
Set default logger level from command line (#256)
* Set default logger level from command line

* Return INVALID_REMAP_RULE

* Add tests

* Do string parsing in rcutils

* Set log level after parsing all arguments

Less convenient but seems cleaner

* Document log arg format, custom return code

* Rename function

* Rename argument

* Refactor argument parsing after rebasing to include param files

* Renaming from param files support

* Doc fixup

* __log -> __log_level

* Use RCUTILS_SAFE_FWRITE_TO_STDERR on bad alloc

* doc fixup

* doc fixup

* Document behaviour if multiple __log_level rules found

* Update docblock formatting

* Label all documentation in arguments.c as internal
2018-06-12 08:11:25 -07:00
William Woodall
9a84b2d7a7
update to use new memory_tools from osrf_testing_tools_cpp (#238)
* remove old memory tools

* updates to use new memory_tools from osrf_testing_tools_cpp

* fixup new test

* fix lambda captures for Windows

* uncrustify fix

* extra_test_env -> rmw_implementation_env_var

* Stray extra_test_libraries

* Use default rmw impl outside of for_each_rmw_implementation loop

* style fixup

* fix typo
2018-06-12 00:13:21 -07:00
Mikael Arguedas
0f8b3eec89
Support passing yaml parameter files via commandline (#253)
* wip

* rcl_arguments_get_param_files() with char **

Restore version of function that outputs a char **

* _rcl_parse_param_rule() allocates string

Before this commit `rcl_parse_params` was allocating space the size of
the argument, but the space only needs to be as big as the argument
minus the prefix length.

* Debug print before incrementing num files

* Alloc and make sure to dealloc on failure

* fix print of parsed parameter rule

* rcutils types not needed as we dont use rcutils_string_array anymore

* minimal test

* cleanup debug prints

* linter fixup

* add tests for param arguments

* lint tests

* Doc for rcl_arguments_get_param_files_count()

* Shrink parameter files

* const param_prefix_len

* Copy parameter file names

* deallocate parameter files in fini

* free memory after tests pass
2018-06-06 01:39:36 +02:00
William Woodall
257b733504
migrate launch -> launch.legacy (#250) 2018-06-05 14:34:00 -07:00
dhood
e39201d6a5
Print warning if non-FQN namespace remapping passed (#248)
* More descriptive error messages

* Special error message when lexeme not found

* Output warning if ns remapping invalid

* Output warning is ns remapping is invalid but starts with /

* Add index to 'not found' error message

* Distinguish between NONE and EOF

* Firmer wording to avoid overlap in meaning
2018-06-04 14:40:32 -07:00
Shane Loretz
95b4147009
Initialize seq_data_type (#245) 2018-05-30 09:41:24 -07:00
anup-pem
5edf27b032 YAML parameter parser (#235)
* Implement a basic YAML based parameter parser for ros2 nodes

* Add README file

* Fix the issues after moving from rcutils_yaml_param_parser to rcl_yaml_param_parser

  - rename folders from rcutils_yaml_param_parser to rcl_yaml_param_parser
  - rename project, header guards and include statements from rcutils_yaml_param_parser to rcl_yaml_param_parser
  - move type declaration in separat file and namespace new structures
  - Fix the code review comments from Mikael

* Few minor changes

   - Changed "params" string to "ros__parameters"
   - Add -Wall, -Wextra and -Wpedantic falgs
   - Fix the compile warning with the new flags

* Fix the changes made in the design of C structure

  - Remove the node_namespaces entry in rcl_params_t
  - Change the type of num_nodes and num_params to size_t

* depend on libyaml_vendor (#236)

* Fix cmake setting standard(C and C++) and add byte_array in C struct

*   Remove C11 so that it defaults to C99

* [rcl_yaml_param_parser] fix export symbols (#237)

* add visibility macros

* remove unused macro

* Support for multi level node and parameter name spaces

* Additional fixes and cleanups

  - Support for string namespace seperator
  - Provide parameter structure init function API
  - name cleanups

* off by 1

* Call yaml_parser_delete()

* fclose(yaml_file)

* free() allocated paths

* Call yaml_event_delete()

* completely deallcoate string array

* Few cleanup changes

  - Add install command into CMakelists.txt
  - Replace one of the zero_allocate with reallocate
  - Pass allocator state
  - Fix int32_t -> rcl_ret_t return value

* Don't include unistd.h

* Use size_t for array indices

* Just pass the allocator in the init function
2018-05-29 18:07:02 +02:00
Michael Carroll
e8491ab8ab
Change #if to #ifdef. (#229)
Needed because you can't use preprocessor on undefined variables in
MISRA.
2018-05-01 17:25:24 -05:00
Shane Loretz
5142a8a4b4
rcl_node_init() copies node options passed into it (#231)
* Add rcl_remap_copy()
* Add rcl_arguments_coy()
* Add rcl_node_options_copy()
* Node copies options passed to it
2018-05-01 12:58:55 -07:00
Karsten Knese
fdd534e19e
Fix memory leak in test_arguments (#230)
valgrind was complaining about some lost memory here. 
The proposed change should fix it.
2018-04-30 09:41:41 -07:00
Shane Loretz
ff024ee9fd
Static remapping with url scheme (#227)
* DIRTY lexer with bugs rosservice: and rostopic:

* Fix bug with partial url schemes

* Style fixes

* Moved lexer.h to satisfy cpplint

* moved terminals to their own array to reduce code size

* Shrink lexer by using char, add error checking

* Comment/whitespace

* comment

* terminal -> lexeme where appropriate

* Static const global

* Documentation and argument order

* Add rcl_lexer_lookahead2_t

* Allow ignoring lexeme text

* Beginnings of recursive descent parser

* Add method to get current position in text

* new remap parsing passes unit tests

* Test rosservice:// and rostopic://

* fix movement formula comment

* doxygent comment

* move code to make pr diff easier to read

* Comments

* Comment

* Comment about impossibilities

* Set error message

* unsigned literals

* Add a couple more url scheme tests

* remove out of date comment

* end_pos -> length

* another token text

* Whitespace

* call accept -> accept

* use array instead of number suffix

* Missing return; wrong comment

* test methods at end of input

* Test not zero-initialized init

* Test lexing remapping rules

* Windows warning

* Remove const to avoid discarding during cast
2018-04-23 10:57:59 -07:00
Michael Carroll
c51f8925f4
Force rcl_arguments_t to be zero initialized. (#225)
* Force rcl_arguments_t to be zero initialized.
* Adds a check for rcl_arguments_t->impl to be NULL before use.
* Updates tests to account for zero initialization.
2018-04-11 12:42:20 -05:00
Dirk Thomas
d41c923927
update doc for rmw_get_node_names to mention potential null values (#214) 2018-03-30 10:56:42 -07:00
Michael Carroll
952c24f8a6
Remove ros arguments (#223)
* Make argument vector const array of const.

* Add remove_ros_arguments method.

* Mark rcl_arguments const where appropriate.
2018-03-27 14:54:05 -07:00
Michael Carroll
f2591483e5
Fix an issue with signed time difference. (#224)
* Fix an issue with signed time difference.
2018-03-26 12:10:37 -07:00
Dirk Thomas
bad0f55416
change export order for static linking (#216) 2018-03-22 16:26:33 -07:00
Shane Loretz
5fa1b0e0d9
CLI remapping followup (#221)
* Document graph functions don't remap

* Prettier if statements using rmw_validate_*

* all arguments on one line

* Whe -> The

* Check args for NULL

* Fix topic remap being interpretted as namespace remap
2018-03-21 15:05:30 -07:00
William Woodall
e48a445f46
Fix docs (#222)
* add missing documentation

* remove unnecessary visibility and warning macros
2018-03-20 10:16:04 -07:00
Shane Loretz
3628967496
Command line static remapping (#217)
Command line static remapping (ROS1 compatible syntax + nodename prefix)
2018-03-16 09:12:34 -07:00
Shane Loretz
7008a7d6e7
Add rcl_validate_topic_name_with_size (#220) 2018-03-15 16:38:57 -07:00