Feature: Load config service#1618
Conversation
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
There was a problem hiding this comment.
| #include <rclcpp/service.hpp> | |
| #include "rviz_common/config.hpp" | |
| #include "rviz_common/window_manager_interface.hpp" | |
| #include "rviz_common/ros_integration/ros_node_abstraction_iface.hpp" | |
| #include "rviz_rendering/render_window.hpp" | |
| #include <rviz_resource_interfaces/srv/load_config.hpp> |
|
|
||
| void | ||
| loadDisplayConfigService( | ||
| const std::shared_ptr<LoadConfig::Request> request, |
There was a problem hiding this comment.
| #include "rclcpp/clock.hpp" | |
| #include <rclcpp/service.hpp> | |
| #include "tf2_ros/buffer.hpp" | |
| #include "tf2_ros/transform_listener.hpp" | |
| #include "rviz_common/load_resource.hpp" | |
| #include "rviz_common/logging.hpp" | |
| #include "rviz_common/panel.hpp" | |
| #include "rviz_common/panel_dock_widget.hpp" | |
| #include "rviz_common/render_panel.hpp" | |
| #include "rviz_common/tool.hpp" | |
| #include "rviz_common/yaml_config_reader.hpp" | |
| #include "rviz_common/yaml_config_writer.hpp" | |
| #include "rviz_rendering/render_window.hpp" | |
| #include <rviz_resource_interfaces/srv/load_config.hpp> |
|
|
||
| /// Load display settings from the given file. | ||
| /** | ||
| * \param path The full path of the config file to load from. |
Signed-off-by: Crola1702 <cristobal.arroyo@ekumenlabs.com>
|
Comments addressed @ahcorde. Thank you! |
ahcorde
left a comment
There was a problem hiding this comment.
cpplint is failing /tmp/ws/src/rviz/rviz_common/src/rviz_common/visualization_frame.cpp:734: At least two spaces is best between code and comments [whitespace/comments] [2]
clalancette
left a comment
There was a problem hiding this comment.
I have two large questions about this feature.
- Do we need this at all? I know the original issue asked for a way to reload configurations without restarting rviz, but I think we have that already. If you click on File->Open and open a config, it will replace the last config. That said, there currently isn't a programmatic way to do it. But before we add more features, I think it would be good to ask the original reporter whether using the GUI would work for them.
- If we do need this, I think that we should split up the implementation of loading the config more. In particular, I think we should have a method
loadDisplayConfigFromYamlwhich takes in aYamlConfigReader. The service can setup a YamlConfigReader from the string, then call this function. We would leave the existing overload ofloadDisplayConfigthat takes a filename, and this would open aYamlConfigReaderwith the file, then callloadDisplayConfigFromYaml. Does that make sense?
I think that we discussed this in person at the hackathon, but I hadn't had a chance to follow-up on a review here yet. |
|
Hi @Crola1702 @mjcarroll, I'm interested in continuing to develop this feature. May I ask if it's still open? Thanks! |
|
@Crola1702 do you want to continue working on this, or can someone else take over? |
Yeah sure! @Crola1702 do you want to continue working on this, or can someone else take over? Someone else can take over. No problem! |
Description
These changes implement the feature requested in #1594, by creating the service when the visualization frame is initialized.
Changes:
loadDisplayConfigwhich now receives a string that can be a path to a configuration file or the configuration yaml stringloadDisplayConfigrviz_resource_interfaces