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

Add ik_time to ReachRecord #75

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

timonegk
Copy link
Contributor

I am currently using reach to evaluate and compare different IK solvers in real-world environments. For this evaluation, it is beneficial to have the time that the IK solver took to solve the request available in the reach database. This pull request adds the IK time to the reach record.

Obviously, this pull request also changes the serialization format of the reach database. I assume therefore that you are not going to merge this pull request as is, but I would like to hear your input on whether you would be open to adding the field to the reach record and how backward compatibility could be guaranteed.

Another idea I had was that it could be an option for plugins to write custom information to the reach database. This could potentially cover more use cases than mine.

@marip8
Copy link
Member

marip8 commented Apr 29, 2024

It's an interesting idea to be able to add custom information to the record.

I think the easiest way would be to modify the existing ReachRecord like you've done in this PR, but update the version number in the serialization (see here for more details)

  template <class Archive>
  inline void serialize(Archive& ar, const unsigned int version)
  {
    ar& BOOST_SERIALIZATION_NVP(reached);
    ar& BOOST_SERIALIZATION_NVP(goal);
    ar& BOOST_SERIALIZATION_NVP(seed_state);
    ar& BOOST_SERIALIZATION_NVP(goal_state);
    ar& BOOST_SERIALIZATION_NVP(score);
+   if (version > 0)
+     ar& BOOST_SERIALIZATION_NVP(ik_time);
  }
};

+ BOOST_CLASS_VERSION(ReachRecord, 1)

Alternatively, we could try to support custom classes that inherit from ReachRecord and provide their own custom data. We would have to figure out a way to support the generation of these custom classes here and how to add that arbitrary information, so this approach seems harder

@marip8
Copy link
Member

marip8 commented Apr 29, 2024

Are you interested in individual solve times or statistics about the solve times? If you care more about the statistics, you could also potentially create a custom IK solver class that caches solve times (possibly mapped to Cartesian position) and extract those stats from your class after the reach study is done. That would be a less invasive change to get that type of information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants