From 2454d79faf21bf0614ee37bb8e7660a39468ebb2 Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Fri, 25 Jun 2021 14:22:34 -0700 Subject: [PATCH 1/8] Ability to optionally define a texture for marker messages Signed-off-by: Greg Balke --- visualization_msgs/CMakeLists.txt | 1 + visualization_msgs/msg/Marker.msg | 10 ++++++++++ visualization_msgs/msg/UVCoordinate.msg | 4 ++++ 3 files changed, 15 insertions(+) create mode 100644 visualization_msgs/msg/UVCoordinate.msg diff --git a/visualization_msgs/CMakeLists.txt b/visualization_msgs/CMakeLists.txt index 1dcfb8a3..09eeef73 100644 --- a/visualization_msgs/CMakeLists.txt +++ b/visualization_msgs/CMakeLists.txt @@ -27,6 +27,7 @@ set(msg_files "msg/Marker.msg" "msg/MarkerArray.msg" "msg/MenuEntry.msg" + "msg/UVCoordinate.msg" ) set(srv_files "srv/GetInteractiveMarkers.srv" diff --git a/visualization_msgs/msg/Marker.msg b/visualization_msgs/msg/Marker.msg index 74d571ff..d7c2fd10 100644 --- a/visualization_msgs/msg/Marker.msg +++ b/visualization_msgs/msg/Marker.msg @@ -56,6 +56,16 @@ geometry_msgs/Point[] points # NOTE: alpha is not yet used std_msgs/ColorRGBA[] colors +# Only used if the marker has a UV mapping defined for it or one is defined using uv_coordinates. +# A URI to where the texture is accessible or the texture itself encoded in Base64. +string texture_map +# Only used when a texture_map is defined and the type specified has some use. +# Location of each vertex within the texture map; in the range: [0.0-1.0] +UVCoordinate[] uv_coordinates +# Only used when a texture_map is defined. +# Causes the rendering engine to reload the given texture if already loaded. +bool texture_update + # Only used for text markers string text diff --git a/visualization_msgs/msg/UVCoordinate.msg b/visualization_msgs/msg/UVCoordinate.msg new file mode 100644 index 00000000..519dfdb8 --- /dev/null +++ b/visualization_msgs/msg/UVCoordinate.msg @@ -0,0 +1,4 @@ +# Location of the pixel as a ratio of the width of a 2D texture. +# Values should be in range: [0.0-1.0]. +float64 u +float64 v From b156448bb3ca1d333066392994bcbbc22e678ab5 Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Fri, 25 Jun 2021 14:53:49 -0700 Subject: [PATCH 2/8] Texture is accessible via uri alone Signed-off-by: Greg Balke --- visualization_msgs/msg/Marker.msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visualization_msgs/msg/Marker.msg b/visualization_msgs/msg/Marker.msg index d7c2fd10..31eaf4c5 100644 --- a/visualization_msgs/msg/Marker.msg +++ b/visualization_msgs/msg/Marker.msg @@ -57,7 +57,7 @@ geometry_msgs/Point[] points std_msgs/ColorRGBA[] colors # Only used if the marker has a UV mapping defined for it or one is defined using uv_coordinates. -# A URI to where the texture is accessible or the texture itself encoded in Base64. +# A URI to where the texture is accessible. string texture_map # Only used when a texture_map is defined and the type specified has some use. # Location of each vertex within the texture map; in the range: [0.0-1.0] From 6688cf9688b1d9613e9aad6640be6b2fa4ac959f Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Tue, 3 Aug 2021 15:26:02 -0700 Subject: [PATCH 3/8] Update to use sensor_msgs/Image as backbone for texture transmission Signed-off-by: Greg Balke --- visualization_msgs/CMakeLists.txt | 3 ++- visualization_msgs/msg/Marker.msg | 11 +++-------- visualization_msgs/package.xml | 2 ++ 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/visualization_msgs/CMakeLists.txt b/visualization_msgs/CMakeLists.txt index 09eeef73..d2ce101a 100644 --- a/visualization_msgs/CMakeLists.txt +++ b/visualization_msgs/CMakeLists.txt @@ -14,6 +14,7 @@ find_package(ament_cmake REQUIRED) find_package(builtin_interfaces REQUIRED) find_package(geometry_msgs REQUIRED) find_package(rosidl_default_generators REQUIRED) +find_package(sensor_msgs REQUIRED) find_package(std_msgs REQUIRED) set(msg_files @@ -36,7 +37,7 @@ set(srv_files rosidl_generate_interfaces(${PROJECT_NAME} ${msg_files} ${srv_files} - DEPENDENCIES builtin_interfaces geometry_msgs std_msgs + DEPENDENCIES builtin_interfaces geometry_msgs sensor_msgs std_msgs ADD_LINTER_TESTS ) diff --git a/visualization_msgs/msg/Marker.msg b/visualization_msgs/msg/Marker.msg index 31eaf4c5..2c975f77 100644 --- a/visualization_msgs/msg/Marker.msg +++ b/visualization_msgs/msg/Marker.msg @@ -56,15 +56,10 @@ geometry_msgs/Point[] points # NOTE: alpha is not yet used std_msgs/ColorRGBA[] colors -# Only used if the marker has a UV mapping defined for it or one is defined using uv_coordinates. -# A URI to where the texture is accessible. -string texture_map -# Only used when a texture_map is defined and the type specified has some use. -# Location of each vertex within the texture map; in the range: [0.0-1.0] +# An image to be loaded into the rendering engine as the texture for this marker. +sensor_msgs/Image texture +# Location of each vertex within the texture; in the range: [0.0-1.0] UVCoordinate[] uv_coordinates -# Only used when a texture_map is defined. -# Causes the rendering engine to reload the given texture if already loaded. -bool texture_update # Only used for text markers string text diff --git a/visualization_msgs/package.xml b/visualization_msgs/package.xml index e7bd18e0..490913fe 100644 --- a/visualization_msgs/package.xml +++ b/visualization_msgs/package.xml @@ -16,12 +16,14 @@ builtin_interfaces geometry_msgs + sensor_msgs std_msgs builtin_interfaces geometry_msgs rosidl_default_runtime std_msgs + sensor_msgs ament_lint_common From d37e404e44524ed35b2231d360a60610a55a2264 Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Tue, 3 Aug 2021 16:03:25 -0700 Subject: [PATCH 4/8] float32 for uv coordinates Signed-off-by: Greg Balke --- visualization_msgs/msg/UVCoordinate.msg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/visualization_msgs/msg/UVCoordinate.msg b/visualization_msgs/msg/UVCoordinate.msg index 519dfdb8..d48b0f29 100644 --- a/visualization_msgs/msg/UVCoordinate.msg +++ b/visualization_msgs/msg/UVCoordinate.msg @@ -1,4 +1,4 @@ # Location of the pixel as a ratio of the width of a 2D texture. # Values should be in range: [0.0-1.0]. -float64 u -float64 v +float32 u +float32 v From 24f48f35925d58444ef590091150f681a1e1296c Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Mon, 16 Aug 2021 16:04:38 -0700 Subject: [PATCH 5/8] URI for various import mechanisms for textures Signed-off-by: Greg Balke --- visualization_msgs/msg/Marker.msg | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/visualization_msgs/msg/Marker.msg b/visualization_msgs/msg/Marker.msg index 2c975f77..d1ea3c12 100644 --- a/visualization_msgs/msg/Marker.msg +++ b/visualization_msgs/msg/Marker.msg @@ -56,8 +56,13 @@ geometry_msgs/Point[] points # NOTE: alpha is not yet used std_msgs/ColorRGBA[] colors +# Texture resource is a special URI that can either reference a texture file in +# a format acceptable to libcurl or: +# "texture_embedded://texture_name" +string texture_resource # An image to be loaded into the rendering engine as the texture for this marker. -sensor_msgs/Image texture +# This will be used iff texture_resource is set to texture_embedded. +sensor_msgs/CompressedImage texture # Location of each vertex within the texture; in the range: [0.0-1.0] UVCoordinate[] uv_coordinates From 995d779b1f410bd921f8303102340e6eda40e654 Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Mon, 16 Aug 2021 16:12:43 -0700 Subject: [PATCH 6/8] Raw mesh transport Signed-off-by: Greg Balke --- visualization_msgs/CMakeLists.txt | 1 + visualization_msgs/msg/Marker.msg | 1 + visualization_msgs/msg/Mesh.msg | 3 +++ 3 files changed, 5 insertions(+) create mode 100644 visualization_msgs/msg/Mesh.msg diff --git a/visualization_msgs/CMakeLists.txt b/visualization_msgs/CMakeLists.txt index d2ce101a..4c4746d5 100644 --- a/visualization_msgs/CMakeLists.txt +++ b/visualization_msgs/CMakeLists.txt @@ -28,6 +28,7 @@ set(msg_files "msg/Marker.msg" "msg/MarkerArray.msg" "msg/MenuEntry.msg" + "msg/Mesh.msg" "msg/UVCoordinate.msg" ) set(srv_files diff --git a/visualization_msgs/msg/Marker.msg b/visualization_msgs/msg/Marker.msg index d1ea3c12..059777be 100644 --- a/visualization_msgs/msg/Marker.msg +++ b/visualization_msgs/msg/Marker.msg @@ -71,4 +71,5 @@ string text # Only used for MESH_RESOURCE markers. string mesh_resource +Mesh mesh bool mesh_use_embedded_materials diff --git a/visualization_msgs/msg/Mesh.msg b/visualization_msgs/msg/Mesh.msg new file mode 100644 index 00000000..e4137b5e --- /dev/null +++ b/visualization_msgs/msg/Mesh.msg @@ -0,0 +1,3 @@ +# Used to send raw mesh files. +string format +uint8[] data From 9b4fb11c3d16cbc4ace91938d736624c1c4336b3 Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Tue, 17 Aug 2021 18:21:01 -0700 Subject: [PATCH 7/8] Updating documentation Signed-off-by: Greg Balke --- visualization_msgs/CMakeLists.txt | 2 +- visualization_msgs/msg/Marker.msg | 11 ++++++++--- visualization_msgs/msg/Mesh.msg | 3 --- visualization_msgs/msg/MeshFile.msg | 8 ++++++++ 4 files changed, 17 insertions(+), 7 deletions(-) delete mode 100644 visualization_msgs/msg/Mesh.msg create mode 100644 visualization_msgs/msg/MeshFile.msg diff --git a/visualization_msgs/CMakeLists.txt b/visualization_msgs/CMakeLists.txt index 4c4746d5..7a239b44 100644 --- a/visualization_msgs/CMakeLists.txt +++ b/visualization_msgs/CMakeLists.txt @@ -28,7 +28,7 @@ set(msg_files "msg/Marker.msg" "msg/MarkerArray.msg" "msg/MenuEntry.msg" - "msg/Mesh.msg" + "msg/MeshFile.msg" "msg/UVCoordinate.msg" ) set(srv_files diff --git a/visualization_msgs/msg/Marker.msg b/visualization_msgs/msg/Marker.msg index 059777be..07d92a91 100644 --- a/visualization_msgs/msg/Marker.msg +++ b/visualization_msgs/msg/Marker.msg @@ -57,8 +57,9 @@ geometry_msgs/Point[] points std_msgs/ColorRGBA[] colors # Texture resource is a special URI that can either reference a texture file in -# a format acceptable to libcurl or: -# "texture_embedded://texture_name" +# a format acceptable to (resource retriever)[https://index.ros.org/p/resource_retriever/] +# or an embedded texture via a string matching the format: +# "embedded://texture_name" string texture_resource # An image to be loaded into the rendering engine as the texture for this marker. # This will be used iff texture_resource is set to texture_embedded. @@ -70,6 +71,10 @@ UVCoordinate[] uv_coordinates string text # Only used for MESH_RESOURCE markers. +# Similar to texture_resource, mesh_resource uses resource retriever to load a mesh. +# Optionally, a mesh file can be sent in-message via the mesh_file field. If doing so, +# use the following format for mesh_resource: +# "embedded://mesh_name" string mesh_resource -Mesh mesh +MeshFile mesh_file bool mesh_use_embedded_materials diff --git a/visualization_msgs/msg/Mesh.msg b/visualization_msgs/msg/Mesh.msg deleted file mode 100644 index e4137b5e..00000000 --- a/visualization_msgs/msg/Mesh.msg +++ /dev/null @@ -1,3 +0,0 @@ -# Used to send raw mesh files. -string format -uint8[] data diff --git a/visualization_msgs/msg/MeshFile.msg b/visualization_msgs/msg/MeshFile.msg new file mode 100644 index 00000000..f7c43398 --- /dev/null +++ b/visualization_msgs/msg/MeshFile.msg @@ -0,0 +1,8 @@ +# Used to send raw mesh files. + +# The filename is used for both debug purposes and to provide a file extension +# for whatever parser is used. +string filename + +# This stores the raw text of the mesh file. +uint8[] data From b0f6600cbc279b4df02f0db3f76e17ad4651514c Mon Sep 17 00:00:00 2001 From: Greg Balke Date: Wed, 18 Aug 2021 14:13:57 -0700 Subject: [PATCH 8/8] Minor doc fix Signed-off-by: Greg Balke --- visualization_msgs/msg/Marker.msg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visualization_msgs/msg/Marker.msg b/visualization_msgs/msg/Marker.msg index 07d92a91..53811d5f 100644 --- a/visualization_msgs/msg/Marker.msg +++ b/visualization_msgs/msg/Marker.msg @@ -62,7 +62,7 @@ std_msgs/ColorRGBA[] colors # "embedded://texture_name" string texture_resource # An image to be loaded into the rendering engine as the texture for this marker. -# This will be used iff texture_resource is set to texture_embedded. +# This will be used iff texture_resource is set to embedded. sensor_msgs/CompressedImage texture # Location of each vertex within the texture; in the range: [0.0-1.0] UVCoordinate[] uv_coordinates