Replies: 1 comment
-
To immobilize one part of the robot, you need to fix the part to the static environment. This must be done with a physics plugin. You can add a physics plugin with the File / New / New Physics Plugin... menu item. In the plugin code, you must simply add an ODE fixed joint between the #include <ode/ode.h>
#include <plugins/physics.h>
void webots_physics_init() {
// get body of the robot part
dBodyID body = dWebotsGetBodyFromDEF("MY_ROBOT_PART");
// get the matching world
dWorldID world = dBodyGetWorld(body);
// the joint group ID is 0 to allocate the joint normally
dJointID joint = dJointCreateFixed(world, 0);
// attach robot part to the static environment: 0
dJointAttach(joint, body, 0);
// fix now: remember current position and rotation
dJointSetFixed(joint);
}
void webots_physics_step() {
// nothing to do
}
void webots_physics_cleanup() {
// nothing to do
} You will find the description of Webots physics plugin API here. You will find the description about the ODE functions on this page. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I need to fix, e.g., pin-point one part of my robot to the static environment.
Can I do this in Webots?
Beta Was this translation helpful? Give feedback.
All reactions