Skip to content

[WIP] Add Kinematic Tag #1953

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jcmayoral
Copy link

I am using dart together with the Gazebo Simulator. And there is a kinematic tag that allows certain links to ignore external forces, like inertia and acceleration.


Before creating a pull request

  • Document new methods and classes
  • Format new code files using ClangFormat by running make format
  • Build with -DDART_TREAT_WARNINGS_AS_ERRORS=ON and resolve all the compile warnings

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change
  • Add Python bindings for new methods and classes

@jslee02
Copy link
Member

jslee02 commented May 6, 2025

You may not need to add a new joint type in that case. Consider specifying the actuator type as either ACCELERATION, VELOCITY, or LOCKED and set the kinematic values (position, velocity, acceleration) as needed:

constexpr Joint::ActuatorType Joint::FORCE;
constexpr Joint::ActuatorType Joint::PASSIVE;
constexpr Joint::ActuatorType Joint::SERVO;
constexpr Joint::ActuatorType Joint::MIMIC;
constexpr Joint::ActuatorType Joint::ACCELERATION;
constexpr Joint::ActuatorType Joint::VELOCITY;
constexpr Joint::ActuatorType Joint::LOCKED;

The joint types (Free, Ball, Revolute) define the joint spaces and how to map the joint space to the joint motion in Cartesian space. However, whether the joint is treated as a kinematic or dynamic joint is determined by the actuator type. Actuator types such as FORCE, PASSIVE, SERVO, and MIMIC are used for dynamic joints, where the solver solves for forward dynamics given q, dq, and tau to find ddq. In contrast, other actuator types are used for kinematic joints, solving for inverse dynamics given q, dq, and ddq to find tau.

@jcmayoral
Copy link
Author

Thanks for answering, I have been testing how to do that. However, I get into trouble when trying to set the velocity to a FreeJoint. It does not move for a reason when I set other actuator type. Anyhow, I want to ignore the acceleration and set the velocity on cartesian space directly. The FreeJoint seems to consider anyway the accelerations to be able to move.

The Kinematic Joint class that I am proposing ignores the acceleration and set the Velocities to the Joint directly. I wanted to add another class for that to avoid affecting the current behavior of dart.

@jslee02
Copy link
Member

jslee02 commented May 6, 2025

Hm, would setting the acceleration to zero not achieve the desired behavior in this case?

Regardless, it would be helpful if you could create a unit or integration test that demonstrates the behavior you're trying to achieve. This would make it easier to identify any bugs or gaps in the existing features and add new functionality as needed. Additionally, having a clear example of your desired outcome will help ensure that we understand your requirements correctly.

@jcmayoral
Copy link
Author

I will handle your comments, and come back.

@jcmayoral jcmayoral mentioned this pull request May 9, 2025
24 tasks
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