-
Notifications
You must be signed in to change notification settings - Fork 430
Add interfaces_state_broadcaster #2006
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
Open
saikishor
wants to merge
14
commits into
ros-controls:master
Choose a base branch
from
pal-robotics-forks:add/generic_state_broadcaster
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+818
−0
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4931294
Add initial commit of generic state broadcaster
saikishor 6875e65
Add first version of the tests
saikishor 7e8e34a
change to new message types
saikishor d2a4b58
update tests
saikishor 6e2980f
add state broadcaster params file
saikishor bfe9c80
rename the package to interfaces state broadcaster
saikishor a0b0b1c
Add release_notes
saikishor ce8f111
Merge branch 'master' into add/generic_state_broadcaster
saikishor dc9b673
Apply suggestions from code review
saikishor ec48562
Apply suggestions from code review
saikishor fdb6f6b
Apply suggestions from code review
saikishor b143897
Apply suggestions from code review
saikishor 839dec3
pre-commit and minor fixes
saikishor 69a46f8
remove wrong include
saikishor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| cmake_minimum_required(VERSION 3.16) | ||
| project(interfaces_state_broadcaster) | ||
|
|
||
| find_package(ros2_control_cmake REQUIRED) | ||
| set_compiler_options() | ||
| export_windows_symbols() | ||
|
|
||
| set(THIS_PACKAGE_INCLUDE_DEPENDS | ||
| builtin_interfaces | ||
| control_msgs | ||
| controller_interface | ||
| generate_parameter_library | ||
| pluginlib | ||
| rclcpp_lifecycle | ||
| realtime_tools | ||
| ) | ||
|
|
||
| find_package(ament_cmake REQUIRED) | ||
| find_package(backward_ros REQUIRED) | ||
| foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS}) | ||
| find_package(${Dependency} REQUIRED) | ||
| endforeach() | ||
|
|
||
| generate_parameter_library(interfaces_state_broadcaster_parameters | ||
| src/interfaces_state_broadcaster_parameters.yaml | ||
| ) | ||
|
|
||
| add_library(interfaces_state_broadcaster SHARED | ||
| src/interfaces_state_broadcaster.cpp | ||
| ) | ||
| target_compile_features(interfaces_state_broadcaster PUBLIC cxx_std_17) | ||
| target_include_directories(interfaces_state_broadcaster PUBLIC | ||
| $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include> | ||
| $<INSTALL_INTERFACE:include/interfaces_state_broadcaster> | ||
| ) | ||
| target_link_libraries(interfaces_state_broadcaster PUBLIC | ||
| interfaces_state_broadcaster_parameters | ||
| controller_interface::controller_interface | ||
| pluginlib::pluginlib | ||
| rclcpp::rclcpp | ||
| rclcpp_lifecycle::rclcpp_lifecycle | ||
| realtime_tools::realtime_tools | ||
| ${control_msgs_TARGETS} | ||
| ${builtin_interfaces_TARGETS}) | ||
| pluginlib_export_plugin_description_file(controller_interface interfaces_state_broadcaster_plugin.xml) | ||
|
|
||
| if(BUILD_TESTING) | ||
| find_package(ament_cmake_gmock REQUIRED) | ||
| find_package(controller_manager REQUIRED) | ||
| find_package(hardware_interface REQUIRED) | ||
| find_package(rclcpp REQUIRED) | ||
| find_package(ros2_control_test_assets REQUIRED) | ||
|
|
||
| ament_add_gmock(test_load_interfaces_state_broadcaster | ||
| test/test_load_interfaces_state_broadcaster.cpp | ||
| ) | ||
| target_link_libraries(test_load_interfaces_state_broadcaster | ||
| interfaces_state_broadcaster | ||
| controller_manager::controller_manager | ||
| hardware_interface::hardware_interface | ||
| rclcpp::rclcpp | ||
| ros2_control_test_assets::ros2_control_test_assets) | ||
| target_compile_definitions( | ||
| test_load_interfaces_state_broadcaster | ||
| PRIVATE PARAMETERS_FILE_PATH="${CMAKE_CURRENT_LIST_DIR}/test/test_interfaces_state_broadcaster_params.yaml") | ||
|
|
||
| ament_add_gmock(test_interfaces_state_broadcaster | ||
| test/test_interfaces_state_broadcaster.cpp | ||
| ) | ||
| target_link_libraries(test_interfaces_state_broadcaster | ||
| interfaces_state_broadcaster | ||
| ros2_control_test_assets::ros2_control_test_assets | ||
| rclcpp::rclcpp | ||
| ${control_msgs_TARGETS}) | ||
| endif() | ||
|
|
||
| install( | ||
| DIRECTORY include/ | ||
| DESTINATION include/interfaces_state_broadcaster | ||
| ) | ||
| install( | ||
| TARGETS | ||
| interfaces_state_broadcaster | ||
| interfaces_state_broadcaster_parameters | ||
| EXPORT export_interfaces_state_broadcaster | ||
| RUNTIME DESTINATION bin | ||
| ARCHIVE DESTINATION lib | ||
| LIBRARY DESTINATION lib | ||
| ) | ||
|
|
||
| ament_export_targets(export_interfaces_state_broadcaster HAS_LIBRARY_TARGET) | ||
| ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS}) | ||
| ament_package() |
83 changes: 83 additions & 0 deletions
83
...s_state_broadcaster/include/interfaces_state_broadcaster/interfaces_state_broadcaster.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| // Copyright (c) 2025, PAL Robotics | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #ifndef INTERFACES_STATE_BROADCASTER__INTERFACES_STATE_BROADCASTER_HPP_ | ||
| #define INTERFACES_STATE_BROADCASTER__INTERFACES_STATE_BROADCASTER_HPP_ | ||
|
|
||
| #include <memory> | ||
| #include <string> | ||
| #include <unordered_map> | ||
| #include <vector> | ||
|
|
||
| #include "control_msgs/msg/dynamic_joint_state.hpp" | ||
| #include "control_msgs/msg/float64_values.hpp" | ||
| #include "control_msgs/msg/keys.hpp" | ||
| #include "realtime_tools/realtime_publisher.hpp" | ||
|
|
||
| // auto-generated by generate_parameter_library | ||
| #include "interfaces_state_broadcaster/interfaces_state_broadcaster_parameters.hpp" | ||
|
|
||
| namespace interfaces_state_broadcaster | ||
| { | ||
| /** | ||
| * \brief Interfaces State Broadcaster for selected state interfaces in a ros2_control system. | ||
| * | ||
| * InterfacesStateBroadcaster publishes the selected state interfaces from ros2_control as ROS | ||
| * messages. | ||
| * | ||
| * Publishes to: | ||
| * - \b ~/names (control_msgs::msg::Keys): The list of the interface names that are selected | ||
| * to be published by the interfaces state broadcaster. This is published with transient local | ||
| * durability. | ||
| * - \b ~/values (control_msgs::msg::Float64Values): The list of the values corresponding to the | ||
| * interface names that are selected to be published by the interfaces state broadcaster. | ||
| * | ||
| * \note The values are published at the same rate as the controller update rate. | ||
| */ | ||
| class InterfacesStateBroadcaster : public controller_interface::ControllerInterface | ||
| { | ||
| public: | ||
| InterfacesStateBroadcaster(); | ||
|
|
||
| controller_interface::InterfaceConfiguration command_interface_configuration() const override; | ||
|
|
||
| controller_interface::InterfaceConfiguration state_interface_configuration() const override; | ||
|
|
||
| controller_interface::return_type update( | ||
| const rclcpp::Time & time, const rclcpp::Duration & period) override; | ||
|
|
||
| controller_interface::CallbackReturn on_init() override; | ||
|
|
||
| controller_interface::CallbackReturn on_configure( | ||
| const rclcpp_lifecycle::State & previous_state) override; | ||
|
|
||
| controller_interface::CallbackReturn on_activate( | ||
| const rclcpp_lifecycle::State & previous_state) override; | ||
|
|
||
| protected: | ||
| // Optional parameters | ||
| std::shared_ptr<ParamListener> param_listener_; | ||
| Params params_; | ||
|
|
||
| // publishers and messages | ||
| std::shared_ptr<rclcpp::Publisher<control_msgs::msg::Keys>> names_publisher_; | ||
| std::shared_ptr<rclcpp::Publisher<control_msgs::msg::Float64Values>> values_publisher_; | ||
| std::shared_ptr<realtime_tools::RealtimePublisher<control_msgs::msg::Float64Values>> | ||
| control_msgs::msg::Keys names_msg_; | ||
| control_msgs::msg::Float64Values values_msg_; | ||
| }; | ||
|
|
||
| } // namespace interfaces_state_broadcaster | ||
|
|
||
| #endif // INTERFACES_STATE_BROADCASTER__INTERFACES_STATE_BROADCASTER_HPP_ |
7 changes: 7 additions & 0 deletions
7
interfaces_state_broadcaster/interfaces_state_broadcaster_plugin.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <library path="interfaces_state_broadcaster"> | ||
| <class name="interfaces_state_broadcaster/InterfacesStateBroadcaster" type="interfaces_state_broadcaster::InterfacesStateBroadcaster" base_class_type="controller_interface::ControllerInterface"> | ||
| <description> | ||
| The interfaces state broadcaster publishes the values of the requested interfaces from ros2_control system. | ||
| </description> | ||
| </class> | ||
| </library> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| <?xml version="1.0"?> | ||
| <package format="3"> | ||
| <name>interfaces_state_broadcaster</name> | ||
| <version>5.8.0</version> | ||
| <description>Broadcaster to publish desired hardware interface states that are castable to double</description> | ||
|
|
||
| <maintainer email="[email protected]">Bence Magyar</maintainer> | ||
| <maintainer email="[email protected]">Denis Štogl</maintainer> | ||
| <maintainer email="[email protected]">Christoph Froehlich</maintainer> | ||
| <maintainer email="[email protected]">Sai Kishor Kothakota</maintainer> | ||
|
|
||
| <author email="[email protected]">Sai Kishor Kothakota</author> | ||
|
|
||
| <license>Apache License 2.0</license> | ||
|
|
||
| <url type="website">https://control.ros.org</url> | ||
| <url type="bugtracker">https://github.com/ros-controls/ros2_controllers/issues</url> | ||
| <url type="repository">https://github.com/ros-controls/ros2_controllers/</url> | ||
|
|
||
| <buildtool_depend>ament_cmake</buildtool_depend> | ||
|
|
||
| <build_depend>ros2_control_cmake</build_depend> | ||
|
|
||
| <depend>backward_ros</depend> | ||
| <depend>builtin_interfaces</depend> | ||
| <depend>control_msgs</depend> | ||
| <depend>controller_interface</depend> | ||
| <depend>generate_parameter_library</depend> | ||
| <depend>pluginlib</depend> | ||
| <depend>rclcpp_lifecycle</depend> | ||
| <depend>rclcpp</depend> | ||
| <depend>realtime_tools</depend> | ||
|
|
||
| <test_depend>ament_cmake_gmock</test_depend> | ||
| <test_depend>controller_manager</test_depend> | ||
| <test_depend>hardware_interface_testing</test_depend> | ||
| <test_depend>hardware_interface</test_depend> | ||
| <test_depend>ros2_control_test_assets</test_depend> | ||
|
|
||
| <export> | ||
| <build_type>ament_cmake</build_type> | ||
| </export> | ||
| </package> |
138 changes: 138 additions & 0 deletions
138
interfaces_state_broadcaster/src/interfaces_state_broadcaster.cpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| // Copyright (c) 2025, PAL Robotics | ||
| // | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| #include "interfaces_state_broadcaster/interfaces_state_broadcaster.hpp" | ||
|
|
||
| #include <cstddef> | ||
| #include <limits> | ||
| #include <memory> | ||
| #include <string> | ||
| #include <unordered_map> | ||
| #include <vector> | ||
|
|
||
| #include "hardware_interface/types/hardware_interface_type_values.hpp" | ||
| #include "rclcpp/qos.hpp" | ||
| #include "rclcpp/time.hpp" | ||
|
|
||
| namespace interfaces_state_broadcaster | ||
| { | ||
|
|
||
| InterfacesStateBroadcaster::InterfacesStateBroadcaster() {} | ||
|
|
||
| controller_interface::CallbackReturn InterfacesStateBroadcaster::on_init() | ||
| { | ||
| try | ||
| { | ||
| param_listener_ = std::make_shared<ParamListener>(get_node()); | ||
| params_ = param_listener_->get_params(); | ||
| } | ||
| catch (const std::exception & e) | ||
| { | ||
| fprintf(stderr, "Exception thrown during init stage with message: %s \n", e.what()); | ||
| return CallbackReturn::ERROR; | ||
| } | ||
|
|
||
| return params_.interfaces.empty() ? CallbackReturn::ERROR : CallbackReturn::SUCCESS; | ||
| } | ||
|
|
||
| controller_interface::InterfaceConfiguration | ||
| InterfacesStateBroadcaster::command_interface_configuration() const | ||
| { | ||
| return controller_interface::InterfaceConfiguration{ | ||
| controller_interface::interface_configuration_type::NONE}; | ||
| } | ||
|
|
||
| controller_interface::InterfaceConfiguration | ||
| InterfacesStateBroadcaster::state_interface_configuration() const | ||
| { | ||
| controller_interface::InterfaceConfiguration state_interfaces_config; | ||
| state_interfaces_config.type = controller_interface::interface_configuration_type::INDIVIDUAL; | ||
| for (const auto & interface : params_.interfaces) | ||
| { | ||
| state_interfaces_config.names.push_back(interface); | ||
| } | ||
| return state_interfaces_config; | ||
| } | ||
|
|
||
| controller_interface::CallbackReturn InterfacesStateBroadcaster::on_configure( | ||
| const rclcpp_lifecycle::State & /*previous_state*/) | ||
| { | ||
| params_ = param_listener_->get_params(); | ||
|
|
||
| names_publisher_ = get_node()->create_publisher<control_msgs::msg::Keys>( | ||
| "~/names", rclcpp::QoS(rclcpp::KeepLast(1)).transient_local()); | ||
| values_publisher_ = get_node()->create_publisher<control_msgs::msg::Float64Values>( | ||
| "~/values", rclcpp::SystemDefaultsQoS()); | ||
| realtime_values_publisher_ = | ||
| std::make_shared<realtime_tools::RealtimePublisher<control_msgs::msg::Float64Values>>( | ||
| values_publisher_); | ||
|
|
||
| values_msg_.values.clear(); | ||
| values_msg_.values.resize(params_.interfaces.size(), std::numeric_limits<double>::quiet_NaN()); | ||
|
|
||
| names_msg_.keys = params_.interfaces; | ||
| names_msg_.header.stamp = get_node()->now(); | ||
| names_publisher_->publish(names_msg_); | ||
|
|
||
| return CallbackReturn::SUCCESS; | ||
| } | ||
|
|
||
| controller_interface::CallbackReturn InterfacesStateBroadcaster::on_activate( | ||
| const rclcpp_lifecycle::State & /*previous_state*/) | ||
| { | ||
| for (auto i = 0u; i < state_interfaces_.size(); ++i) | ||
| { | ||
| if (!state_interfaces_[i].is_castable_to_double()) | ||
| { | ||
| RCLCPP_ERROR( | ||
| get_node()->get_logger(), | ||
| "State interface '%s' is not castable to double. The InterfacesStateBroadcaster only " | ||
| "supports " | ||
| "state interfaces that can be casted to double.", | ||
| params_.interfaces[i].c_str()); | ||
| return CallbackReturn::FAILURE; | ||
| } | ||
| } | ||
|
|
||
| return CallbackReturn::SUCCESS; | ||
| } | ||
|
|
||
| controller_interface::return_type InterfacesStateBroadcaster::update( | ||
| const rclcpp::Time & time, const rclcpp::Duration & /*period*/) | ||
| { | ||
| for (auto i = 0u; i < state_interfaces_.size(); ++i) | ||
| { | ||
| const auto & opt = state_interfaces_[i].get_optional(); | ||
| if (opt.has_value()) | ||
| { | ||
| values_msg_.values[i] = opt.value(); | ||
| } | ||
| } | ||
|
|
||
| if (realtime_values_publisher_) | ||
| { | ||
| values_msg_.header.stamp = time; | ||
| realtime_values_publisher_->try_publish(values_msg_); | ||
| } | ||
|
|
||
| return controller_interface::return_type::OK; | ||
| } | ||
|
|
||
| } // namespace interfaces_state_broadcaster | ||
|
|
||
| #include "pluginlib/class_list_macros.hpp" | ||
|
|
||
| PLUGINLIB_EXPORT_CLASS( | ||
| interfaces_state_broadcaster::InterfacesStateBroadcaster, | ||
| controller_interface::ControllerInterface) | ||
10 changes: 10 additions & 0 deletions
10
interfaces_state_broadcaster/src/interfaces_state_broadcaster_parameters.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| interfaces_state_broadcaster: | ||
| interfaces: { | ||
| type: string_array, | ||
| default_value: [], | ||
| description: "The list of hardware interfaces information to be published by the interfaces state broadcaster.", | ||
| read_only: true, | ||
| validation: { | ||
| not_empty<>: [] | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fallback to NaNs is silent, shall we log a warning here to ease the debugging ?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually, it should be the previous value instead right?. Moreover, at the usual observation rate of 50Hz, i don't think it is an issue.
If needed, I can make the change 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's true. We can hold off the change. I’ve started playing with this controller through a new demo that uses an ONNX model to drive the humanoid’s motions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's amazing. Was it useful?
I'm really interested to know your feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still working on this and will circle back once I'm done. Just to clarify, I'm doing all this in simulation, I don't have a real robot yet :).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. No problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. No problem
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sharing some early findings: this broadcaster works great when training data matches its format/order. If not, we may need to do some post processing. For the Humanoid Lite biped example, its observation vector expects
The new broadcaster gives us #2, #4, and #5. Since #3 needs to be calculated, to put together the observations, we run two broadcasters to cover all fields or one broadcaster with data filtering. Are these reasonable ?
Note, Example_18 is still pretty much a wip. The initial wiring is done, the robot can be launched in Gazebo, but none of code logic has been exercised yet.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saikishor, I’ve made enough progress with
example_18and I thought I could share some thoughts on the new broadcaster.One of the nicest things to use this brand-new broadcaster is that I didn't need to bring up any additional sensor (i.e. IMU) broadcaster and subscribe corresponding topic. The other benefit is that the interface can be ordered so that some optimization can be done when extracting them. In my case, Interfaces are pre-ordered to match the observation vector (IMU → joint positions → velocities), so the controller can copy contiguous blocks without lookups; extract_interface_data() simply slices the incoming array assuming that order, avoiding per-field search or maps. This second point is a double-edged sword, though, which means the changes in the YAML file could lead to incorrect input vector without good care.
It is hard to predict the input for the training data for a model, especially when some of the fields are derived, so what defined in this broadcaster won't satisfy the need for all fields. The other thing I noticed is that with ONNX it expects a float instead of double so even the input vector is perfect aligned with the interfaces list, the data conversation may be still required.
The example_18 is yet to be a cool demo, the robot falls down too easily. Not sure what yet, may need to check with Berkeyley folks to see whether there is any mismatched date point. The other thing that I need to figure out why there are so many commands were clamped ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the intended best-case scenerio!
As this is a general generic state broadcaster, we would certainly expect to not subscribe any additional topic or use any additional broadcaster. And I'm sure, it was the intended usage.