0

Since RigidBodyTree is on its way out, I'm trying to use MultibodyPlant to study my closed loop multibody robot.

I'm testing things out using the drake/examples/simple_four_bar/FourBar.sdf

my_plant, scene_graph = AddMultibodyPlantSceneGraph(builder)
Parser(plant=my_plant).AddModelFromFile("FourBar.sdf")

But get the following error

RuntimeError: This mobilizer is creating a closed loop since the outboard body already has an inboard mobilizer connected to it. If a physical loop is really needed, consider using a constraint instead.

I'm guessing I should be using AddForceElement to add the constraint forces as shown under Bilateral Position Constraints, is that correct?

I would further believe that DoCalcAndAddForceContribution should implement the constraint force lambda. However, what would be the CalcPotentialEnergy, CalcConservativePower, CalcNonConservativePower?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Rufus
  • 5,111
  • 4
  • 28
  • 45
  • I believe there is a plan to have an alternative workaround by using a bushing force element (which I guess implements a less-stiff bilateral position constraint?): https://github.com/RobotLocomotion/drake/issues/11831 – Eric Cousineau Oct 28 '19 at 00:08
  • @EricCousineau is correct. The current plan is to provide a force element so that as a first pass, users have the option to model a weld constraint as a very stiff spring element. The second pass will include actual constraints but this project is not on our current short term plans yet. – Alejandro Oct 28 '19 at 14:59
  • To elaborate a bit more, I am trying to model a robot arm connected to the ground, pushing a wheel against a vertical wall (also connected to the ground). For that, I would need a position constraint (to ensure the wheel does not penetrate nor leave the wall) and also a force representing the force generated when a torque is applied on the wheel to make it travel up the wall. – Rufus Oct 28 '19 at 16:15
  • @Rufus can you model the wheel/wall interaction as contact? In Drake that does not require a constraint since our contact is compliant. The wheel could be a contact cylinder or sphere and would have stiffness, damping, and friction. – Sherm Oct 28 '19 at 21:42
  • @Sherm I'm afraid I'm not quite sure what is meant by modelling the interaction as contacts... I'm trying to do trajopt of the arm-wheel-wall system where one of the assumption (constraint) is that the wheel is always pushed against the wall. I reckon a reasonable simplification would be to treat the wheel-wall interaction as a simple prismatic joint, hence the closed loop system, and enforcing the "pushing wheel against wall" constraint separately. Wouldn't treating the wheel-wall interface as contacts make it harder to solve? – Rufus Oct 29 '19 at 14:18
  • @Rufus I assumed you were interested in simulation in which case a unilateral contact force would make sense. I'm not sure what you need for trajectory optimization -- a prismatic joint makes sense if you want to constrain the robot to make contact, though it could produce negative contact forces. Since Drake MultibodyPlant doesn't yet allow joints to form loops, you have to use a force element somewhere to break the loop. – Sherm Oct 30 '19 at 15:26

0 Answers0