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

Marker textures #153

Merged
merged 9 commits into from
Aug 20, 2021
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion visualization_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -27,6 +28,7 @@ set(msg_files
"msg/Marker.msg"
"msg/MarkerArray.msg"
"msg/MenuEntry.msg"
"msg/UVCoordinate.msg"
)
set(srv_files
"srv/GetInteractiveMarkers.srv"
Expand All @@ -35,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
)

Expand Down
10 changes: 10 additions & 0 deletions visualization_msgs/msg/Marker.msg
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ 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:
Copy link
Contributor

Choose a reason for hiding this comment

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

We should add to the documentation references to resource retriever and use it like we already do for the meshes. (This lets us use package:// syntax too)

https://index.ros.org/p/resource_retriever/

Then for the embedded approach I might suggest embedded://name or attached://name and then we can mirror it and used the same keyword for the mesh.

# "texture_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.
gbalke marked this conversation as resolved.
Show resolved Hide resolved
sensor_msgs/CompressedImage texture
# Location of each vertex within the texture; in the range: [0.0-1.0]
UVCoordinate[] uv_coordinates

# Only used for text markers
string text

Expand Down
4 changes: 4 additions & 0 deletions visualization_msgs/msg/UVCoordinate.msg
Original file line number Diff line number Diff line change
@@ -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].
float32 u
float32 v
2 changes: 2 additions & 0 deletions visualization_msgs/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

<build_depend>builtin_interfaces</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>

<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<exec_depend>std_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>

<test_depend>ament_lint_common</test_depend>

Expand Down