-
Notifications
You must be signed in to change notification settings - Fork 31
Feature/rg traversability #53
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
base: develop
Are you sure you want to change the base?
Changes from all commits
64c865c
daa875d
7ef040b
597031f
f96d586
ce0705e
78ce5b4
77f05a0
019b67f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| launch: | ||
| - arg: { name: start_visualizer, default: "true" } | ||
| - arg: { name: scene, default: office, description: uhumans2 scene name } | ||
| - arg: { name: use_gt_semantics, default: "true" } | ||
| - arg: { name: use_openset_places, default: "false" } | ||
| - arg: { name: labelspace, default: $(if $(var use_gt_semantics) uhumans2_$(var scene) ade20k_full) } | ||
| - arg: { name: log_prefix, default: uhumans2_$(var scene) } | ||
| - arg: { name: label_remap_path, default: $(find-pkg-share hydra)/config/label_remaps/uhumans2_$(var scene).yaml } | ||
| - set_remap: { from: hydra/input/left_cam/depth_registered/image_rect, to: /tesse/depth_cam/mono/image_raw } | ||
| - set_remap: { from: hydra/input/left_cam/rgb/image_raw, to: /tesse/left_cam/rgb/image_raw } | ||
| - set_remap: { from: hydra/input/left_cam/rgb/camera_info, to: /tesse/left_cam/camera_info } | ||
| - set_remap: | ||
| { | ||
| from: hydra/input/left_cam/semantic/image_raw, | ||
| to: $(if $(var use_gt_semantics) /tesse/seg_cam/converted/image_raw /tesse/left_cam/semantic/image_raw), | ||
| } | ||
| - set_remap: { from: hydra/input/left_cam/feature, to: /tesse/left_cam/semantic/feature } | ||
| - let: { name: extra_yaml_gt, value: "{semantic_label_remap_filepath: $(var label_remap_path)}" } | ||
| - let: { name: extra_yaml_no_gt, value: "{}" } | ||
| - group: | ||
| - push_ros_namespace: { namespace: tesse/left_cam } | ||
| - set_remap: { from: color/image_raw, to: rgb/image_raw } | ||
| - include: | ||
| if: $(not $(var use_gt_semantics)) | ||
| file: $(find-pkg-share semantic_inference_ros)/launch/closed_set.launch.yaml | ||
| arg: | ||
| - { name: labelspace_name, value: $(var labelspace) } | ||
| - include: | ||
| if: $(var use_openset_places) | ||
| file: $(find-pkg-share semantic_inference_ros)/launch/image_embedding_node.launch.yaml | ||
| arg: | ||
| - { name: min_period_s, value: "0.2" } | ||
| - include: | ||
| file: $(find-pkg-share hydra_ros)/launch/hydra.launch.yaml | ||
| arg: | ||
| - { name: dataset, value: uhumans2 } | ||
| - { name: labelspace, value: $(var labelspace) } | ||
| - { name: log_prefix, value: $(var log_prefix) } | ||
| - { name: sensor_frame, value: left_cam } | ||
| - { name: robot_frame, value: base_link_gt } | ||
| - { name: odom_frame, value: world } | ||
| - { name: map_frame, value: map } | ||
| - { name: lcd_config_path, value: $(find-pkg-share hydra)/config/lcd/uhumans2.yaml } | ||
| - { name: extra_yaml, value: $(if $(var use_gt_semantics) $(var extra_yaml_gt) $(var extra_yaml_no_gt)) } | ||
| - { name: hydra_config_path, value: $(find-pkg-share hydra)/config/datasets/lukas_trav.yaml } | ||
| - { name: rviz_path, value: $(find-pkg-share hydra_visualizer)/rviz/lukas_trav.rviz } | ||
|
|
||
| - include: | ||
| file: $(find-pkg-share khronos_ros)/launch/datasets/play_uhumans.launch.yaml | ||
| arg: | ||
| - { name: bag_file, value: /home/lukas/data/khronos/tesse_cd_office.bag } | ||
| - { name: use_gt_frame, value: "true" } | ||
| - { name: play_rate, value: "1.0" } | ||
|
|
||
| - node: | ||
| pkg: tf2_ros | ||
| name: tf_world_to_map | ||
| exec: static_transform_publisher | ||
| args: --frame-id world --child-frame-id map | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -58,7 +58,7 @@ class TraversabilityPlugin : public VisualizerPlugin { | |
| float slice_height = 2.0f; | ||
|
|
||
| //! line width of the boundary markers | ||
| float line_width = 0.05f; | ||
| float line_width = 0.07f; | ||
| }; | ||
|
|
||
| TraversabilityPlugin(const Config& config, | ||
|
|
@@ -82,6 +82,14 @@ class TraversabilityPlugin : public VisualizerPlugin { | |
| const spark_dsg::SceneGraphLayer& layer, | ||
| visualization_msgs::msg::MarkerArray& msg) const; | ||
|
|
||
| void drawBlockBoundary(const Config& config, | ||
| const spark_dsg::TraversabilityNodeAttributes& attrs, | ||
| visualization_msgs::msg::Marker& marker) const; | ||
|
|
||
| void drawRegionBoundary(const Config& config, | ||
| const spark_dsg::TravNodeAttributes& attrs, | ||
| visualization_msgs::msg::Marker& marker) const; | ||
|
|
||
| void addBoundaryPoint(const Config& config, | ||
| visualization_msgs::msg::Marker& marker, | ||
| const Eigen::Vector3d& point, | ||
|
|
@@ -91,6 +99,14 @@ class TraversabilityPlugin : public VisualizerPlugin { | |
| config::DynamicConfig<Config> config_; | ||
| rclcpp::Publisher<visualization_msgs::msg::MarkerArray>::SharedPtr pub_; | ||
| mutable MarkerTracker tracker_; | ||
|
|
||
| // Start and stop indices for the corner points of the boundary along the state | ||
| // direction. | ||
| inline static const std::array<std::pair<size_t, size_t>, 4> state_pairs_ = { | ||
| std::make_pair(1, 0), | ||
| std::make_pair(1, 2), | ||
| std::make_pair(2, 3), | ||
| std::make_pair(0, 3)}; | ||
| }; | ||
|
Comment on lines
+105
to
110
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (minor) I'd generally prefer a struct and brace initializers here, but I wouldn't both with cleanup unless I have any other actionable code comments |
||
|
|
||
| void declare_config(TraversabilityPlugin::Config& config); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,13 @@ | ||
| --- | ||
| launch: | ||
| - arg: {name: verbosity, default: '0', description: visualizer verbosity} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I need to add my yaml formatter ('yamlfix') to the pre-commit, I think I dropped it at some point from Hydra because Jared was having trouble getting it to work in 20.04. Preference to revert these changes and I can drop the color adapter args on my side |
||
| - arg: {name: debug, default: 'false', description: launch with gdb server} | ||
| - arg: {name: scene_graph, default: '', description: filepath for scene graph to show} | ||
| - arg: {name: visualizer_frame, default: map, description: frame_id for visualizations} | ||
| - arg: {name: visualizer_ns, default: hydra_dsg_visualizer, description: visualizer namespace} | ||
| - arg: {name: visualizer_config_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_config.yaml} | ||
| - arg: {name: visualizer_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_plugins.yaml} | ||
| - arg: {name: external_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/external_plugins.yaml} | ||
| - arg: {name: use_color_adapter, default: 'false', description: Start visualizer using mesh color adapter} | ||
| - arg: { name: verbosity, default: "0", description: visualizer verbosity } | ||
| - arg: { name: debug, default: "false", description: launch with gdb server } | ||
| - arg: { name: scene_graph, default: "", description: filepath for scene graph to show } | ||
| - arg: { name: visualizer_frame, default: map, description: frame_id for visualizations } | ||
| - arg: { name: visualizer_ns, default: hydra_dsg_visualizer, description: visualizer namespace } | ||
| - arg: { name: visualizer_config_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_config.yaml } | ||
| - arg: { name: visualizer_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_plugins.yaml } | ||
| - arg: { name: external_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/external_plugins.yaml } | ||
| # visualizer node and control for launching | ||
| - node: | ||
| pkg: hydra_visualizer | ||
|
|
@@ -22,11 +21,16 @@ launch: | |
| --config-utilities-file $(var external_plugins_path) | ||
| --config-utilities-yaml {glog_level: 0, glog_verbosity: $(var verbosity)} | ||
| --config-utilities-yaml {graph: {type: GraphFromFile, frame_id: $(var visualizer_frame), filepath: $(var scene_graph)}} | ||
| --config-utilities-yaml {plugins: {mesh: {use_color_adapter: $(var use_color_adapter)}}} | ||
| # rviz node and control for launching | ||
| - arg: {name: start_rviz, default: 'true', description: automatically start rviz} | ||
| - arg: {name: rviz_path, default: $(find-pkg-share hydra_visualizer)/rviz/static_visualizer.rviz, description: rviz file to load} | ||
| - node: {if: $(var start_rviz), name: rviz, pkg: rviz2, exec: rviz2, args: -d $(var rviz_path)} | ||
| - arg: { name: start_rviz, default: "true", description: automatically start rviz } | ||
| - arg: | ||
| { | ||
| name: rviz_path, | ||
| default: $(find-pkg-share hydra_visualizer)/rviz/static_visualizer.rviz, | ||
| description: rviz file to load, | ||
| } | ||
| - node: { if: $(var start_rviz), name: rviz, pkg: rviz2, exec: rviz2, args: -d $(var rviz_path) } | ||
| # reconfiguration of dynamic configurations | ||
| - arg: {name: start_config_gui, default: 'true', description: automatically start config_utilities configuration GUI} | ||
| - node: {if: $(var start_config_gui), name: dynamic_config_gui, pkg: config_utilities_ros, exec: gui} | ||
| - arg: | ||
| { name: start_config_gui, default: "true", description: automatically start config_utilities configuration GUI } | ||
| - node: { if: $(var start_config_gui), name: dynamic_config_gui, pkg: config_utilities_ros, exec: gui } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,19 @@ | ||
| --- | ||
| launch: | ||
| # development args | ||
| - arg: {name: verbosity, default: '0'} | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ditto on reverting the formatting, I'll fix the pre-commit this afternoon |
||
| - arg: {name: debug, default: 'false'} | ||
| - arg: { name: verbosity, default: "0" } | ||
| - arg: { name: debug, default: "false" } | ||
| # visualizer configuration | ||
| - arg: {name: visualizer_ns, default: hydra_visualizer} | ||
| - arg: {name: visualizer_config_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_config.yaml} | ||
| - arg: {name: visualizer_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_plugins.yaml} | ||
| - arg: {name: external_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/external_plugins.yaml} | ||
| - arg: {name: use_color_adapter, default: 'false', description: Start visualizer using mesh color adapter} | ||
| - arg: { name: visualizer_ns, default: hydra_visualizer } | ||
| - arg: { name: visualizer_config_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_config.yaml } | ||
| - arg: { name: visualizer_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/visualizer_plugins.yaml } | ||
| - arg: { name: external_plugins_path, default: $(find-pkg-share hydra_visualizer)/config/external_plugins.yaml } | ||
| # communication | ||
| - arg: {name: use_zmq, default: 'false', description: use zmq to receive scene graphs} | ||
| - arg: {name: visualizer_frame, default: map, description: frame ID for zmq to use} | ||
| - arg: {name: zmq_url, default: 'tcp://127.0.0.1:8001', description: full zmq url} | ||
| - arg: { name: use_zmq, default: "false", description: use zmq to receive scene graphs } | ||
| - arg: { name: visualizer_frame, default: map, description: frame ID for zmq to use } | ||
| - arg: { name: zmq_url, default: "tcp://127.0.0.1:8001", description: full zmq url } | ||
| # visualizer node and control for launching | ||
| - arg: {name: start_visualizer, default: 'true'} | ||
| - arg: { name: start_visualizer, default: "true" } | ||
| - node: | ||
| if: $(var start_visualizer) | ||
| pkg: hydra_visualizer | ||
|
|
@@ -28,8 +27,12 @@ launch: | |
| --config-utilities-file $(var external_plugins_path) | ||
| --config-utilities-yaml {glog_level: 1, glog_verbosity: $(var verbosity)} | ||
| --config-utilities-yaml {graph: {type: $(if $(var use_zmq) GraphFromZmq GraphFromRos), url: $(var zmq_url), frame_id: $(var visualizer_frame)}} | ||
| --config-utilities-yaml {plugins: {mesh: {use_color_adapter: $(var use_color_adapter)}}} | ||
| # rviz node and control for launching | ||
| - arg: {name: start_rviz, default: 'true', description: automatically start rviz} | ||
| - arg: {name: rviz_path, default: $(find-pkg-share hydra_visualizer)/rviz/streaming_visualizer.rviz, description: rviz file to load} | ||
| - node: {if: $(var start_rviz), name: rviz, pkg: rviz2, exec: rviz2, args: -d $(var rviz_path)} | ||
| - arg: { name: start_rviz, default: "true", description: automatically start rviz } | ||
| - arg: | ||
| { | ||
| name: rviz_path, | ||
| default: $(find-pkg-share hydra_visualizer)/rviz/streaming_visualizer.rviz, | ||
| description: rviz file to load, | ||
| } | ||
| - node: { if: $(var start_rviz), name: rviz, pkg: rviz2, exec: rviz2, args: -d $(var rviz_path) } | ||
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.
We can talk about how to do this a little bit more cleanly on the hydra_ros side, but I've tried to avoid this in general because you don't get keyboard controls to manage the playback, and you don't get tab-complete for the bag path (though I like having only one thing to run). Longer term thing though