Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal parameters api #30

Merged
merged 6 commits into from
May 19, 2015
Merged

Internal parameters api #30

merged 6 commits into from
May 19, 2015

Conversation

esteve
Copy link
Member

@esteve esteve commented May 14, 2015

This adds the API acting on parameters on instances of nodes.

Connects to ros2/ros2#11

Connects to ros2/ros2#28

@dirk-thomas @tfoote @wjwwood

@esteve esteve added the in progress Actively being worked on (Kanban column) label May 14, 2015
@tfoote
Copy link
Contributor

tfoote commented May 15, 2015

Nice. Looks good to me.

Node::set_parameters_atomically(
const std::vector<rcl_interfaces::Parameter> & parameters)
{
std::lock_guard<std::mutex> lock(mutex_);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@esteve can you explain a little bit why we need a mutex here but not in the other functions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an oversight from me, I'll lock the mutex to every method.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just locked the mutex in every method. Thanks @wjwwood

@wjwwood
Copy link
Member

wjwwood commented May 15, 2015

lgtm

@esteve esteve mentioned this pull request May 15, 2015
esteve added a commit that referenced this pull request May 19, 2015
@esteve esteve merged commit de2f707 into master May 19, 2015
@esteve esteve removed the in progress Actively being worked on (Kanban column) label May 19, 2015
@esteve esteve deleted the internal-parameters-api branch May 19, 2015 22:27
@@ -146,6 +148,24 @@ class Node
FunctorT callback,
rclcpp::callback_group::CallbackGroup::SharedPtr group = nullptr);

const std::vector<rcl_interfaces::SetParametersResult> set_parameters(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why return a const non-reference here? If it can't be a reference what is the purpose of const then?

if (kv.first.find(prefix + ".") == 0) {
size_t length = prefix.length();
std::string substr = kv.first.substr(length);
return std::count(substr.begin(), substr.end(), '.') < depth;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line results in a compile warning. @esteve Can you please update it to build without warnings?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#37

mauropasse pushed a commit to mauropasse/rclcpp that referenced this pull request Nov 19, 2020
nnmm pushed a commit to ApexAI/rclcpp that referenced this pull request Jul 9, 2022
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
* ros2GH-23 Get all topics from node and sanitize

* ros2GH-23 Move methods to node for better interface

* ros2GH-23 Use rmw_serialized_message_t consistently

* ros2GH-23 Improve santization of topics

* ros2GH-65 Introduce and use better logging macros

* ros2GH-23 Use publisher to serialized message directly

* ros2GH-23 Improve readability of sanitizing topics and types

* ros2GH-23 Allow to write all available topics

* ros2GH-23 Add test for record all

* ros2GH-23 Cleanup: add missing const ref to record interface

* Cleanup for doxygen

* Improve topic sanitization

- correctly expand topic names using rcl
- do not check type correctness (supposed to be done internally)

* Pass topic_name by reference
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
…ackage (ros2#48)

* ros2GH-111 Add package for converter plugins

* ros2GH-111 Add CDR converter plugin

* ros2GH-111 Add test for more primitives types

* ros2GH-116 Fix cdr converter after rebase on new converters interface

* ros2GH-116 Use rmw_serialize/rmw_deserialize directly in converter and link against rmw_fastrtps_cpp

* Fix converter package.xml

* Fix clang warnings

* ros2GH-30 Change interface to the same convention as rmw_(de)serialize

* comply to new rcutils error handling API

* use poco to load fastrtps

* Update rosbag2_converter_default_plugins/src/rosbag2_converter_default_plugins/cdr/cdr_converter.cpp

Co-Authored-By: Karsten1987 <[email protected]>
DensoADAS pushed a commit to DensoADAS/rclcpp that referenced this pull request Aug 5, 2022
* ros2GH-112 Open storage for reading handing in rmw_identifier

* ros2GH-113 Cleanup: better naming

* ros2GH-113 Introduce interface for StorageFactory to allow mocks in tests

* ros2GH-113 Add test for SequentialReader for using converters

- Added mocks for storage and converters (and factories)

* ros2GH-113 Implement skeleton convert function

- Use convert only if necessary (different input and output formats),
  converters are only loaded if really necessary.
- Allocate_ros2_message is public to enable extensive tests for this function.
- Helper function to get any typesupport by name
- Helper function for empty ros2_message

* ros2GH-113 Implement allocate_ros2_message

- Treats most messages already.
- Some combinations of nested messages with arrays are still missing
- Cleanup of DynamicArrayNested messages is failing
- Main difficulty is the cleanup of the allocated ros2_message which
needs to be done manually
- The test_ros2_message is intended to be run with valgrind and there
should be no leaks or problems with free!

* ros2GH-113 Fix DynamicArrayNested deallocation

Swapping with empty container seems more stable than deleting the data
pointer of the container.

* ros2GH-113 Add test for BoundedArrayNested deallocation

* ros2GH-113 Refactoring of deallocation code

* ros2GH-113 Fix string initialization in all types

* ros2GH-113 Fix vector<bool> initialization

* ros2GH-113 Add test for deallocation of topic name + Refactoring

* ros2GH-113 Minor refactoring of converter

* ros2GH-113 Make sure to throw an error if converters do not exist

* ros2GH-113 Delete superfluous imports

* ros2GH-113 Small fix for deleting vectors

* ros2GH-113 Fix build after rebase

* ros2GH-30 Minor refactoring

- The TODO comments have been removed because they're no longer relevant: they have been discussed in the PR review

* ros2GH-30 Give an allocator as parameter to allocate_ros2_message()

* ros2GH-111 Add missing test dependencies for CDR converter test

* ros2GH-128 Extend message allocation test to also cover big strings

- Big strings are not treated with small string optimization and need
  to be checked, too.

* ros2GH-128 Add tests for nested arrays

* ros2GH-128 always initialize vectors with a placement new

* pass by ref

* use new getter functions

* consistent function naming

*  uncrustify

* ros2GH-30 Fix windows build

* use visibility macros on all functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants