Commit graph

33 commits

Author SHA1 Message Date
Ethan Gao
261a46772f segmentation fault for NULL dereference (#202)
* Invalid memory access for NULL dereference

rcl_lifecycle_get_state may return NULL

transition->goal is checked for NULL but no return
while it's true and this may result the follow-up
NULL dereference

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

* Avoid crash while NULL returned from rcl_service_get_options()

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

* tweak error string and null check for current_state

Signed-off-by: Ethan Gao <ethan.gao@linux.intel.com>
2017-12-13 08:31:18 -08:00
Mikael Arguedas
b41d4e333e 0.4.0 2017-12-08 18:06:51 -08:00
Karsten Knese
f21880bb2c
do not deallocate state/transition pointer within the fini functions (#200) 2017-12-06 17:26:35 -08:00
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
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
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
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
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
Dirk Thomas
ad044b509a reset expected error msg to avoid warning 2017-08-11 15:06:19 -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
Dirk Thomas
a57f66b54c 0.0.2 2017-06-30 15:11:46 -07:00
Karsten Knese
c37bfec072 use rcl_allocator for rcl_lifecycle & namespaced topics (#142)
* use rcl_allocator for rcl_lifecycle

* correct return value interpretation

* fix unsigned comparison

* use namespace for lifecycle in-built topics

* linters
2017-06-16 14:44:06 -07:00
Esteve Fernandez
0f2519944a Explicitly set C11 and C++14 via the CMake variables (#141)
* Explicitly set C99 and C++14 via the CMake variables

* Enable passing CMAKE_C_STANDARD and CMAKE_CXX_STANDARD externally

* Use add_compile_options

* Be more specific about the compiler, independent from the OS

* Check compiler, not OS. Use add_compile_options instead of CMAKE_C_FLAGS and CMAKE_CXX_FLAGS

* add_compile_options() takes a list, not a string

* switch to c11 because of redefinition warnings

avoid typedef redifinition warning on macos

remove todo, compiler come from redefinition of typedef
2017-06-16 13:23:59 -07:00
Karsten Knese
6fbfb4ee07 Warn unused (#139)
* add unused warning

* comply with unused warning

* add unused warning

* comply with unused warning

* remove wrongly modified files

* consistent include style
2017-05-25 19:52:25 -07:00
William Woodall
cbfe6b90f9 Namespace expansion (#132)
* update to use new rmw function name

* add rcl_validate_topic_name()

* add rcl_expand_topic_name()

* gcc couldn't handle the init lists with tuples

* uncrustify and cpplint

* fix signed compare warnings

* address comments

* organize the substitution string constants together at the top of the file

* comment
2017-05-09 15:15:57 -07:00
dhood
fc75c58962 Debug info for test_rcl_get_node_names (#133)
* Debug output for failed node_names test

* Give test nodes unique names

* Put test name in printout
2017-05-02 10:25:48 -07:00
William Woodall
bed40d3d40 rename {c_}utilities to rcutils (#130) 2017-04-20 11:15:03 -07:00
Karsten Knese
f9e03e51bb use c_utilities packages (#129)
* use c_utilities packages

* use rmw topic validation

* fix rebase/merge commits

* alphabetical includes
2017-04-19 15:40:41 -07:00
William Woodall
90176d9f1a move allocator and error handling to c utilities (#122)
* moved allocator to c_utilities

* moved error_handling to c_utilities

* refactor uses of RCL_SET_ERROR_MSG with allocator

* add missing guard condition functions and tests

* add missing timer functions

* refactor rcl_lifecycyle

* missed an instance of RCL_SET_ERROR_MSG

* fix segfaults in error cases for rcl_lifecycle

* remove extra header

* check return code of rcl_lifecycle_init_default_state_machine
2017-04-19 12:37:48 -07:00
William Woodall
64f1b16d2f add concept of node namespace to rcl API (#112)
* add concept of node namespace to rcl API

also validate node name and node namespace

* name_space -> namespace_

* doc clarification

* make use of rmw_validate_namespace()

* clear expected error messages in test_node.cpp

* avoid unused invalid_index

* include the validation result value when it is unknown

* use _snprintf_s on windows

* uncrustify
2017-04-08 02:04:51 -07:00
Dirk Thomas
c429f2e18c Merge pull request #106 from ros2/use_rmw_impl
use rmw implementation
2017-01-09 08:54:15 -08:00
Dirk Thomas
7a54a0e32f remove obsolete CMake functions 2017-01-06 15:51:47 -08:00
dhood
c6b050e7c7 Fix cmake for appending c/cxx flags (#104) 2017-01-06 07:48:32 +10:00
Dirk Thomas
72e7d03198 use rmw implementation 2017-01-05 12:02:04 -08:00
Mikael Arguedas
e3c1427591 dependency order (#105) 2017-01-05 17:28:08 +01:00
Dirk Thomas
b1a30f0ecd Merge pull request #102 from ros2/typesupport_c_reloaded
typesupport c reloaded
2016-12-28 09:02:33 -08:00
Hunter Allen
5f74a081e1 Require C11 (#101)
* Made CMake enforce the C11 standard during build.
2016-12-23 08:34:17 -08:00
Dirk Thomas
da2897982a typesupport c reloaded 2016-12-22 09:47:40 -08:00
Karsten Knese
a18ef97e5a add rcl lifecycle
* (refactor) add rcl_lifecycle package

* (refactor) cleanup free calls

* (fix) initialize state machine with external node handle

* (dev) use external typesupport

* (fix) use external typesupport

* (fix) cleanup states

* (fix) no pointer comparison in state machine

* (test) refactor for rcl testing purpose

* (test) test suite for lifecycle sequence

* (dev) change to rcl_ret_t

* (test) wrong transition test

* (fix) dependency for isolated build

* (clean) remove std_msgs as a dep

* (fix) enable correct visibility control

* (fix) correct test for initialization

* (fix) correct visibility attributes

* (dev) change default value to lifecycle_msgs

* (clean) style and lifecycle prefix

* (dev) cmake macro get_rcl_lifecycle_information

* (cleanup) remove unused files'

* (cleanup) remove callback pointer

* (debug) add print state machine function

* (review) address review comments

* (bugfix) correct export in information.cmake

* (fix) correct visibility control

* (vcs) fix convertion from size_t to unsigned int

* (typo) fix internal struct name

* const correctness

* get_available_states service

* new service msgs

* tes for multiple instances

* (dev) return codes

* initial refactor

* test default sequence

* refactor state machine

* apply upstream changes

* c++14

* disable state machine print

* address review comments

* uncrustify

* fix comparison with unsigned warning
2016-12-14 09:28:54 -08:00