Giter Site home page Giter Site logo

the future of ompl::base::State about ompl HOT 5 CLOSED

ompl avatar ompl commented on May 24, 2024
the future of ompl::base::State

from ompl.

Comments (5)

mamoll avatar mamoll commented on May 24, 2024

Original comment by gipson_b (Bitbucket: gipson_b, ).


(Reply via [email protected]):

I'll give a strong second to this, a state is meaningless without context, and it's often the case that a StateSpace is required when working with States.
For example when distance computations are required.

from ompl.

mamoll avatar mamoll commented on May 24, 2024

Original comment by Mark Moll (Bitbucket: mamoll, GitHub: mamoll).


Having a StateSpace pointer in every state would eliminate the need for ScopedState. However, the justification for not having this pointer that in any context where you accessing states you also have access to the state space, directly or indirectly (via SpaceInformation or SimpleSetup). Your math for memory usage is not quite right. If I have a compound state space with n copies of SO(2), the memory usage would double. If I start nesting compound state spaces, it gets even worse. IMO, more raw pointers will lead to more bugs. It's hard to guarantee that a state contains a pointer to the right state space (not just the right type, but the right instance). The semantics of who is responsible for allocation/deletion of states could get a little fuzzy. As you can tell, I am not so keen on it.

from ompl.

mamoll avatar mamoll commented on May 24, 2024

Original comment by Ryan Luna (Bitbucket: rluna, GitHub: rluna).


I'm not necessarily against adding the member pointer, but I'm not sure it is actually useful and the change may introduce more problems than it fixes.

Nearly every component has access to the StateSpace via SpaceInformation, and all of the general state operations can already be accessed there. Since the raw pointer would be saved in the state object, there could be some issues if the StateSpace was destroyed but some states were still hanging on to this pointer. We are currently insulated from this by using glorified blobs for states, which are distinct from the instance of StateSpace from which they were created (ScopedState uses StateSpacePtr). Also, creating a state the "easy way" using new may actually require more code since we would still need a handle to the StateSpace to give to the newly created state.

from ompl.

mamoll avatar mamoll commented on May 24, 2024

Original comment by Ioan Sucan (Bitbucket: isucan, GitHub: isucan).


This makes sense. We should not do it for now.

from ompl.

mamoll avatar mamoll commented on May 24, 2024

Original comment by Mark Moll (Bitbucket: mamoll, GitHub: mamoll).


appveyor fix #6

from ompl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.