Skip to content
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

Simulation.h: fix type-matching and const errors in templates. #2008

Merged
merged 1 commit into from
Apr 5, 2016

Conversation

rpoyner-tri
Copy link
Contributor

  • simulate(5-arg): don't modify the passed options struct.
    • restore const to options arg, to get sim(4) a fighting chance.
  • simulate(4-arg): fix a typo that defeats template resolution.

@rpoyner-tri
Copy link
Contributor Author

@jwnimmer-tri: please review this PR.

if (options.realtime_factor < 0.0) options.realtime_factor = 0.0;
const SimulationOptions& options) {
SimulationOptions my_options = options;
if (my_options.realtime_factor < 0.0) my_options.realtime_factor = 0.0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you investigate whether any calling code relies on this broken output-writeback behavior?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I did the grep for this, and didn't see any code that touched realtime_factor after simulate() or runLCM() is called. (I did find that runLCM re-implements the "negative means 1.0" rule, but shrug.)

@jwnimmer-tri
Copy link
Collaborator

Comments in notes. LGTM.

@rpoyner-tri
Copy link
Contributor Author

@jwnimmer-tri: i did not investigate reliance on brokenness further than "no tests failed". @david-german-tri assures us us (from f2f discussion) that broader reform is imminent, so I didn't dig any deeper.

As for sim(arity-4), it was clearly just dead code before I resuscitated it.

@rpoyner-tri
Copy link
Contributor Author

I'll incorporate @david-german-tri 's suggestion and send it through again.

 * simulate(5-arg): (re?) const-ify options struct argument.
   * since that is clearly what simulate(4-arg) requires.
 * simulate(4-arg): fix a typo that defeats template resolution.
@rpoyner-tri
Copy link
Contributor Author

revised patch is up. @jwnimmer-tri , @david-german-tri , please have a look. Thanks!

@jwnimmer-tri
Copy link
Collaborator

LGTM.

@david-german-tri
Copy link
Contributor

LGTM as well

@jwnimmer-tri
Copy link
Collaborator

@david-german-tri Hmm. I think we are going to need to close (and tag and) and reopen this, to get drake005 coverage?

@rpoyner-tri
Copy link
Contributor Author

didn't drake0005 already run?

@jwnimmer-tri
Copy link
Collaborator

Huh. When I commented, it had not, but its there now.

Ah, I see. More of us got added to the whitelist, so that the "approved for build servers" tag is not required.

@jwnimmer-tri
Copy link
Collaborator

Two reviews done, four CI reports green, bombs away!

@jwnimmer-tri jwnimmer-tri merged commit c2159e3 into RobotLocomotion:master Apr 5, 2016
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.

3 participants