gazebosim / gazebosim/gz-rendering

Move user data storage to Node from Visual

Open
#58 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
C++
Stars
81
Forks
90
Avg merge
1d 13h
Merged PRs (30d)
10

Description

**Original report ([archived issue](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/issues/58)) by John Shepherd (Bitbucket: [John Shepherd](https://bitbucket.org/%7Bc4803212-effe-4921-9323-02cd01b8bc9c%7D/), GitHub: [jshep1](https://github.com/jshep1)).**

----------------------------------------
# Summary

I propose that we move the functions `SetUserData` and `UserData` currently residing within the Visual to the Node class in Dome. This will not affect the current usage of the function, but could provide better scalability.

# Motivation

The functions `SetUserData` and `UserData` were introduced in [This PR](https://osrf-migration.github.io/ignition-gh-pages/#!/ignitionrobotics/ign-rendering/pull-requests/200/support-storing-user-data-in-visual/diff). It's become quite handy in that certain data can be accessed and set at the plugin level without having to depend upon other classes. Accessing a visual's entity id as well as being able to set booleans (via ints) in order to give a preview of what moving a visual to a given location might look like without having to make the service request has become quite useful. However, I do have to make downcasts from NodePtr -> VisualPtr in order to access this function which is not guaranteed to succeed. Moving both of these functions would maintain the current Visual user data support while also solving my issue of downcasting.

# Describe alternatives you've considered

Currently, I'm casting from a Node to Visual which isn't guaranteed to succeed as a work-around.

What do you think? @iche033

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.