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

PLEXIL uses LightSetIntensity action #98

Merged
merged 3 commits into from
Nov 30, 2022

Conversation

kmdalal
Copy link
Contributor

@kmdalal kmdalal commented Nov 29, 2022

Summary:

  • PLEXIL now uses the ROS action for LightSetIntensity instead of the service.
  • set_light_intensity and SetLightIntensity have been renamed to light_set_intensity and LightSetIntensity, respectively, everywhere.
  • Support for ROS services is completely removed.

Unrelated changes:

  • Refactored the initialization of action status subscribers, eliminating the individual member pointers.
  • Minor code reformatting.

Test:

  • First, ow_plexil should be rebuilt clean, because a plan was renamed.
  • Start any simulator world.
  • Run the TestLanderLights plan, e.g.
    $ roslaunch ow_plexil ow_exec.launch plan:=TestLanderLights.plx
  • Watch both Gazebo and the ow_exec terminal, which explains what you should see in Gazebo as the plan runs. (It happens fast, don't blink!).
  • Run ReferenceMission1 for regression. It should complete without incident.

Notes:

  • The major code changes are in OwInterface.cpp. Changes elsewhere are trivial.

@AstroStucky
Copy link
Contributor

First run I saw the following

[ERROR] [1669830912.194065798, 1916524827.017499924]: ArmMoveJoint action server did not connect!

Everything appeared to work, but the test went too fast for me to follow. So I'm trying it again now.

@AstroStucky
Copy link
Contributor

I did not see that error the second time around. It may have resulted from me starting ow_plexil a little too soon after starting the simulation.

The lander lights test performed as expected. I might recommend increasing the wait time between commands to make it easier to follow.

ReferenceMission1 performed as expected.

All tests pass 👍🏻

Copy link
Contributor

@AstroStucky AstroStucky left a comment

Choose a reason for hiding this comment

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

No real comments on the code aside from a suggestion about how parameter checking could be simplified in the future.

Approved!

"should be in range [0.0 1.0]", intensity);
valid_args = false;
}
if (valid_args) {
unique_ptr<CommandRecord>& cr = new_command_record(cmd, intf);
OwInterface::instance()->setLightIntensity (side, intensity, CommandId);
OwInterface::instance()->lightSetIntensity (side, intensity, CommandId);
acknowledge_command_sent(*cr);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

No change requests here, just something to consider for your refactoring of this code.

Verifying action input here in ow_plexil requires an awful lot of repetition of logic already performed by the action servers.

Could an alternative approach be to send arguments to the action server blindly, and let the action server perform value checks? Out of range values should result in an aborted action from the action server, which ow_plexil could look for (and perhaps already does). The user still gets the benefit of knowing why the command was aborted, only that message would come from the simulation terminal rather than the ow_plexil terminal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good suggestion, though I'm not sure if that's better than the redundant check, which has its advantages (e.g. performance, customizing the message). It would apply to many actions. Will keep this in mind during future development.

@kmdalal kmdalal self-assigned this Nov 30, 2022
@kmdalal
Copy link
Contributor Author

kmdalal commented Nov 30, 2022

First run I saw the following

[ERROR] [1669830912.194065798, 1916524827.017499924]: ArmMoveJoint action server did not connect!

This is an unrelated problem, and I agree with your guess that plexil may have been started too soon. I rarely if ever have seen this error.

@kmdalal kmdalal merged commit 851eb98 into noetic-devel Nov 30, 2022
@kmdalal kmdalal deleted the OCEANWATER-1072-LightSetIntensity branch November 30, 2022 23:08
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