Coder Social home page Coder Social logo

Comments (11)

rhaschke avatar rhaschke commented on September 23, 2024

Would you like to prepare a PR to fix that issue? It seems you already well analysed the issue.

from moveit_ros.

v4hn avatar v4hn commented on September 23, 2024

Thank you for the analysis @jonbinney, this is really informative.
This issue popped up somewhere else some weeks ago, I don't remember where though..
Would it be a good idea to expose the RobotModel to the IK plugins?

from moveit_ros.

jonbinney avatar jonbinney commented on September 23, 2024

Yes, I think that (at least part of) the RobotModel would need to be exposed to the kinematics plugin in order to properly fix this. The current initialize function of KinematicsBase (which the kinematics plugins inherit from) is:

 virtual bool initialize(const std::string& robot_description,
                          const std::string& group_name,
                          const std::string& base_frame,
                          const std::string& tip_frame,
                          double search_discretization) = 0;

The problem is that as things have evolved, the robot_description no longer contains all of the information about the robot that the kinematics solvers need. We could pass the RobotModel to the initialize function, as @v4hn points out. That would actually simplify the kinematics plugins, since they wouldn't have to parse the URDF themselves. A few design questions:

  • do kinematics plugins need the entire RobotModel? Or is the JointModel for their joints enough?
  • this would be a pretty big change; in theory all other kinematics plugins that people have written for specific robots would have to be updated, right? This shouldn't be done lightly.
  • should the kinematics plugin also get a ROS NodeHandle so that it can load its own, algorithm-specific parameters from within some namespace?

Basically, if the API is going to be modified, I think it's worth getting input from people on what other limitations they've found with it.

from moveit_ros.

jonbinney avatar jonbinney commented on September 23, 2024

Two alternatives that wouldn't require changing the API:

  • deprecate setting of min and max positions in joint_limits parameter. People would have to modify the URDF to change the joint limits, but at least behavior would be consistent.
  • Have KDLKinematicsPlugin instantiate its own RobotModel, reading in the joint_model parameters in the process. This feels ugly, because it is re-doing work and because it assumes that the parameters are in the root of the node's namespace.

from moveit_ros.

v4hn avatar v4hn commented on September 23, 2024

from moveit_ros.

rhaschke avatar rhaschke commented on September 23, 2024

+1

from moveit_ros.

jonbinney avatar jonbinney commented on September 23, 2024

@v4hn that sounds reasonable, and shouldn't be too much work. I'll put together the PRs for it (one to moveit_core for adding a function to KinematicBase and one to moveit_ros for updating the KDL plugin)

from moveit_ros.

jonbinney avatar jonbinney commented on September 23, 2024

Hmmm... turns out my development setup is a bit precarious at the moment. I'm using kinetic+xenial, and everything works with some odd combination of repos that I found; including some of @davetcoleman's branches of some things. When I try to switch back to kinetic-devel branches of things so I can create a PR that will be useful, things don't compile because of the whole FCL/Octomap on kinetic thing.

from moveit_ros.

davetcoleman avatar davetcoleman commented on September 23, 2024

+1!

@jonbinney great analysis of the discontinuity in joint limits for IK solvers. I am a big proponent of passing in the RobotModel to all IK solvers because it also significantly improves MoveIt! loading time - by default an IK solver is loaded (and a URDF is parsed) for every planning group in your SRDF that has a solver specified. In addition if you are multi-threading your solving, such as in the manipulation pipeline, you have to load a solver for each thread.

In fact I created the exact PRs you mentioned for moveit_core and moveit_ros and have been using it since 2014. I'm still a bit bitter though that it was closed (not merged) after sitting unanswered for a year. @sachinchitta finally gave the following feedback:

I think this functionality is important and very significant but it feels ad-hoc and weird to have RobotModel use kinematics base as a building block and vice-versa. I would prefer it if we rethink the relationship between the two in a more fundamental way - I think robot model should offer some kinematics solvers by default internally and expose a plugin model for other types of solvers.

While I do agree that its not ideal to have "RobotModel use kinematics base as a building block and vice-versa" I think a fundamental change in this relationship is a huge undertaking that would break major API and not something we want to do at the moment.

Note also that KinematicBase already has a dependency on RobotState, and thus RobotModel, when calling searchPositionIK

I'd welcome someone cleaning up or getting inspiration from my implementation!

from moveit_ros.

jonbinney avatar jonbinney commented on September 23, 2024

@davetcoleman hah - those old PRs do pretty much exactly what we were talking about. I'll revive them and make sure they still work; then we can have a discussion in the PRs about the specifics.

from moveit_ros.

jonbinney avatar jonbinney commented on September 23, 2024

Quick update: I'm going to wait until after the repo merge on friday to submit the PR. I think there will be a fair amount of discussion on it; it will be a good use case for the unified repo.

from moveit_ros.

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.