首页 > 解决方案 > 如何防止重力加速地平面?

问题描述

sdf我目前有一个带有以下标签的格式定义的地平面

在我的源文件中,我指定

plant.AddForceElement<UniformGravityFieldElement>();

问题:

  1. <static><gravity>标签是否受到尊重?还是这GravityFieldElement会影响一切?
  2. 如果标签不被尊重,我如何防止GravityFieldElement加速我的地平面?

标签: drake

解决方案


添加地平面的一种方法是

Vector3<double> normal_W(0, 0, 1);
Vector3<double> point_W(0, 0, 0);

const CoulombFriction<double> surface_friction(
  0.8 /* static friction */, 0.3 /* dynamic friction */);

// A half-space for the ground geometry.
plant.RegisterCollisionGeometry(
    plant.world_body(), HalfSpace::MakePose(normal_W, point_W),
    HalfSpace(), "collision", surface_friction);

// Add visual for the ground.
plant.RegisterVisualGeometry(
    plant.world_body(), HalfSpace::MakePose(normal_W, point_W),
    HalfSpace(), "visual");

之后plant.Finalize()

plant.set_penetration_allowance(0.001);

虽然我非常想知道是否有办法通过sdf


推荐阅读