How to debug `InputPort::Eval(): required InputPort[0] is not connected`How do you set, clear, and toggle a single bit?How do I iterate over the words of a string?Debugging with command-line parameters in Visual StudioHow can I profile C++ code running on Linux?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?Debug vs Release in CMakeWhat is an undefined reference/unresolved external symbol error and how do I fix it?(__imp_? Name decorationflood of unresolved external symbol errorsTemplate instantiation unable to match argument list for overloaded stream operator when invoked between headers
Is Electric Central Heating worth it if using Solar Panels?
What is this word supposed to be?
Israeli soda type drink
What is the term for a person whose job is to place products on shelves in stores?
My bank got bought out, am I now going to have to start filing tax returns in a different state?
A Paper Record is What I Hamper
Could moose/elk survive in the Amazon forest?
Is it acceptable to use working hours to read general interest books?
"Whatever a Russian does, they end up making the Kalashnikov gun"? Are there any similar proverbs in English?
Is there metaphorical meaning of "aus der Haft entlassen"?
What was Apollo 13's "Little Jolt" after MECO?
How much of a wave function must reside inside event horizon for it to be consumed by the black hole?
Magical attacks and overcoming damage resistance
Can a level 2 Warlock take one level in rogue, then continue advancing as a warlock?
Is there a word for the censored part of a video?
How bug prioritization works in agile projects vs non agile
Combinatorics problem, right solution?
Can a stored procedure reference the database in which it is stored?
What makes accurate emulation of old systems a difficult task?
How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?
"The cow" OR "a cow" OR "cows" in this context
Is this a typo in Section 1.8.1 Mathematics for Computer Science?
Why did C use the -> operator instead of reusing the . operator?
Where was the County of Thurn und Taxis located?
How to debug `InputPort::Eval(): required InputPort[0] is not connected`
How do you set, clear, and toggle a single bit?How do I iterate over the words of a string?Debugging with command-line parameters in Visual StudioHow can I profile C++ code running on Linux?C++11 introduced a standardized memory model. What does it mean? And how is it going to affect C++ programming?Debug vs Release in CMakeWhat is an undefined reference/unresolved external symbol error and how do I fix it?(__imp_? Name decorationflood of unresolved external symbol errorsTemplate instantiation unable to match argument list for overloaded stream operator when invoked between headers
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
Background
I am trying to simulate a double pendulum mounted on a cart. I used the examples/multibody/cart_pole/cart_pole_simulation.cc
as a starting point.
I created a new .sdf
based on cart_pole.sdf
and added for my double pendulum cart. I've verified (visually, through drake-visualizer) that the sdf
file appears correct (changing the joint values moves the model as expected)
Due to the addition of a new joint, I added the following line to my source file (where mid_joint
is the name of the joint between the first link of the pendulum and the second link of the pendulum.
const RevoluteJoint<double>& mid_joint = tribot.GetJointByName<RevoluteJoint>("mid_joint");
mid_joint.set_angle(&tribot_context, 0.0);
Problem
My program compiles correctly, but I get the following error when I try to run my system.
terminate called after throwing an instance of 'std::logic_error'
what(): InputPort::Eval(): required InputPort[0] (geometry_query) of System ::_::drake/multibody/MultibodyPlant@0000560ea69178f0 (MultibodyPlant<double>) is not connected
Any pointers on what this error is pointing to would be greatly appreciated.
Thanks in advance
(PS:: If anyone could tell me how to more formally verify an sdf
file, that would be helpful)
Solution (thanks to Russ's answer)
Below are the changes required to fix the error
- SceneGraph<double>& scene_graph = *builder.AddSystem<SceneGraph>();
+ auto pair = AddMultibodyPlantSceneGraph(&builder, std::make_unique<MultibodyPlant<double>>(FLAGS_time_step));
+ MultibodyPlant<double>& plant = pair.plant;
+
+ SceneGraph<double>& scene_graph = pair.scene_graph;
- MultibodyPlant<double>& plant =
- *builder.AddSystem<MultibodyPlant>(FLAGS_time_step);
- builder.Connect(
- plant.get_geometry_poses_output_port(),
- scene_graph.get_source_pose_port(plant.get_source_id().value()));
c++ drake
add a comment |
Background
I am trying to simulate a double pendulum mounted on a cart. I used the examples/multibody/cart_pole/cart_pole_simulation.cc
as a starting point.
I created a new .sdf
based on cart_pole.sdf
and added for my double pendulum cart. I've verified (visually, through drake-visualizer) that the sdf
file appears correct (changing the joint values moves the model as expected)
Due to the addition of a new joint, I added the following line to my source file (where mid_joint
is the name of the joint between the first link of the pendulum and the second link of the pendulum.
const RevoluteJoint<double>& mid_joint = tribot.GetJointByName<RevoluteJoint>("mid_joint");
mid_joint.set_angle(&tribot_context, 0.0);
Problem
My program compiles correctly, but I get the following error when I try to run my system.
terminate called after throwing an instance of 'std::logic_error'
what(): InputPort::Eval(): required InputPort[0] (geometry_query) of System ::_::drake/multibody/MultibodyPlant@0000560ea69178f0 (MultibodyPlant<double>) is not connected
Any pointers on what this error is pointing to would be greatly appreciated.
Thanks in advance
(PS:: If anyone could tell me how to more formally verify an sdf
file, that would be helpful)
Solution (thanks to Russ's answer)
Below are the changes required to fix the error
- SceneGraph<double>& scene_graph = *builder.AddSystem<SceneGraph>();
+ auto pair = AddMultibodyPlantSceneGraph(&builder, std::make_unique<MultibodyPlant<double>>(FLAGS_time_step));
+ MultibodyPlant<double>& plant = pair.plant;
+
+ SceneGraph<double>& scene_graph = pair.scene_graph;
- MultibodyPlant<double>& plant =
- *builder.AddSystem<MultibodyPlant>(FLAGS_time_step);
- builder.Connect(
- plant.get_geometry_poses_output_port(),
- scene_graph.get_source_pose_port(plant.get_source_id().value()));
c++ drake
add a comment |
Background
I am trying to simulate a double pendulum mounted on a cart. I used the examples/multibody/cart_pole/cart_pole_simulation.cc
as a starting point.
I created a new .sdf
based on cart_pole.sdf
and added for my double pendulum cart. I've verified (visually, through drake-visualizer) that the sdf
file appears correct (changing the joint values moves the model as expected)
Due to the addition of a new joint, I added the following line to my source file (where mid_joint
is the name of the joint between the first link of the pendulum and the second link of the pendulum.
const RevoluteJoint<double>& mid_joint = tribot.GetJointByName<RevoluteJoint>("mid_joint");
mid_joint.set_angle(&tribot_context, 0.0);
Problem
My program compiles correctly, but I get the following error when I try to run my system.
terminate called after throwing an instance of 'std::logic_error'
what(): InputPort::Eval(): required InputPort[0] (geometry_query) of System ::_::drake/multibody/MultibodyPlant@0000560ea69178f0 (MultibodyPlant<double>) is not connected
Any pointers on what this error is pointing to would be greatly appreciated.
Thanks in advance
(PS:: If anyone could tell me how to more formally verify an sdf
file, that would be helpful)
Solution (thanks to Russ's answer)
Below are the changes required to fix the error
- SceneGraph<double>& scene_graph = *builder.AddSystem<SceneGraph>();
+ auto pair = AddMultibodyPlantSceneGraph(&builder, std::make_unique<MultibodyPlant<double>>(FLAGS_time_step));
+ MultibodyPlant<double>& plant = pair.plant;
+
+ SceneGraph<double>& scene_graph = pair.scene_graph;
- MultibodyPlant<double>& plant =
- *builder.AddSystem<MultibodyPlant>(FLAGS_time_step);
- builder.Connect(
- plant.get_geometry_poses_output_port(),
- scene_graph.get_source_pose_port(plant.get_source_id().value()));
c++ drake
Background
I am trying to simulate a double pendulum mounted on a cart. I used the examples/multibody/cart_pole/cart_pole_simulation.cc
as a starting point.
I created a new .sdf
based on cart_pole.sdf
and added for my double pendulum cart. I've verified (visually, through drake-visualizer) that the sdf
file appears correct (changing the joint values moves the model as expected)
Due to the addition of a new joint, I added the following line to my source file (where mid_joint
is the name of the joint between the first link of the pendulum and the second link of the pendulum.
const RevoluteJoint<double>& mid_joint = tribot.GetJointByName<RevoluteJoint>("mid_joint");
mid_joint.set_angle(&tribot_context, 0.0);
Problem
My program compiles correctly, but I get the following error when I try to run my system.
terminate called after throwing an instance of 'std::logic_error'
what(): InputPort::Eval(): required InputPort[0] (geometry_query) of System ::_::drake/multibody/MultibodyPlant@0000560ea69178f0 (MultibodyPlant<double>) is not connected
Any pointers on what this error is pointing to would be greatly appreciated.
Thanks in advance
(PS:: If anyone could tell me how to more formally verify an sdf
file, that would be helpful)
Solution (thanks to Russ's answer)
Below are the changes required to fix the error
- SceneGraph<double>& scene_graph = *builder.AddSystem<SceneGraph>();
+ auto pair = AddMultibodyPlantSceneGraph(&builder, std::make_unique<MultibodyPlant<double>>(FLAGS_time_step));
+ MultibodyPlant<double>& plant = pair.plant;
+
+ SceneGraph<double>& scene_graph = pair.scene_graph;
- MultibodyPlant<double>& plant =
- *builder.AddSystem<MultibodyPlant>(FLAGS_time_step);
- builder.Connect(
- plant.get_geometry_poses_output_port(),
- scene_graph.get_source_pose_port(plant.get_source_id().value()));
c++ drake
c++ drake
edited Mar 10 at 15:44
Woofas
asked Mar 9 at 7:47
WoofasWoofas
590322
590322
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
I think that you're close. The reason that your code has departed from the examples/multibody/cart_pole/cart_pole_simulation.cc
starting point is that your cartpole.sdf
almost certainly added some collision geometry, which was not present in the original example. As such, your MultibodyPlant
system needs to be connected to your SceneGraph
object in the other direction, too... so that MultibodyPlant
can ask geometry questions about collisions.
The simple solution is to change the few lines that create your MultibodyPlant/SceneGraph
to look more like the example in e.g. examples/multibody/inclined_plant/inclined_plane_run_dynamics.cc
.
I think we want to improve the experience of people that might use your workflow, and have opened https://github.com/RobotLocomotion/drake/issues/10874 .
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075161%2fhow-to-debug-inputporteval-required-inputport0-is-not-connected%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
I think that you're close. The reason that your code has departed from the examples/multibody/cart_pole/cart_pole_simulation.cc
starting point is that your cartpole.sdf
almost certainly added some collision geometry, which was not present in the original example. As such, your MultibodyPlant
system needs to be connected to your SceneGraph
object in the other direction, too... so that MultibodyPlant
can ask geometry questions about collisions.
The simple solution is to change the few lines that create your MultibodyPlant/SceneGraph
to look more like the example in e.g. examples/multibody/inclined_plant/inclined_plane_run_dynamics.cc
.
I think we want to improve the experience of people that might use your workflow, and have opened https://github.com/RobotLocomotion/drake/issues/10874 .
add a comment |
I think that you're close. The reason that your code has departed from the examples/multibody/cart_pole/cart_pole_simulation.cc
starting point is that your cartpole.sdf
almost certainly added some collision geometry, which was not present in the original example. As such, your MultibodyPlant
system needs to be connected to your SceneGraph
object in the other direction, too... so that MultibodyPlant
can ask geometry questions about collisions.
The simple solution is to change the few lines that create your MultibodyPlant/SceneGraph
to look more like the example in e.g. examples/multibody/inclined_plant/inclined_plane_run_dynamics.cc
.
I think we want to improve the experience of people that might use your workflow, and have opened https://github.com/RobotLocomotion/drake/issues/10874 .
add a comment |
I think that you're close. The reason that your code has departed from the examples/multibody/cart_pole/cart_pole_simulation.cc
starting point is that your cartpole.sdf
almost certainly added some collision geometry, which was not present in the original example. As such, your MultibodyPlant
system needs to be connected to your SceneGraph
object in the other direction, too... so that MultibodyPlant
can ask geometry questions about collisions.
The simple solution is to change the few lines that create your MultibodyPlant/SceneGraph
to look more like the example in e.g. examples/multibody/inclined_plant/inclined_plane_run_dynamics.cc
.
I think we want to improve the experience of people that might use your workflow, and have opened https://github.com/RobotLocomotion/drake/issues/10874 .
I think that you're close. The reason that your code has departed from the examples/multibody/cart_pole/cart_pole_simulation.cc
starting point is that your cartpole.sdf
almost certainly added some collision geometry, which was not present in the original example. As such, your MultibodyPlant
system needs to be connected to your SceneGraph
object in the other direction, too... so that MultibodyPlant
can ask geometry questions about collisions.
The simple solution is to change the few lines that create your MultibodyPlant/SceneGraph
to look more like the example in e.g. examples/multibody/inclined_plant/inclined_plane_run_dynamics.cc
.
I think we want to improve the experience of people that might use your workflow, and have opened https://github.com/RobotLocomotion/drake/issues/10874 .
answered Mar 9 at 8:46
Russ TedrakeRuss Tedrake
31115
31115
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55075161%2fhow-to-debug-inputporteval-required-inputport0-is-not-connected%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown