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

No timeout on scale/retract overrides #145

Merged
merged 4 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions buoy_gazebo/src/controllers/PowerController/PowerController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,19 @@ const rcl_interfaces::msg::FloatingPointRange PowerControllerServices::valid_win
.set__from_value(-35.0F)
.set__to_value(35.0F);

const rclcpp::Duration PowerControllerServices::SCALE_COMMAND_TIMEOUT{300, 0U};
// never time out on scale
const rclcpp::Duration PowerControllerServices::SCALE_COMMAND_TIMEOUT{
std::numeric_limits<int>::max(),
0U};
const rcl_interfaces::msg::FloatingPointRange PowerControllerServices::valid_scale_range_ =
rcl_interfaces::msg::FloatingPointRange()
.set__from_value(0.5F)
.set__to_value(1.4F);

const rclcpp::Duration PowerControllerServices::RETRACT_COMMAND_TIMEOUT{300, 0U};
// never time out on retract
const rclcpp::Duration PowerControllerServices::RETRACT_COMMAND_TIMEOUT{
std::numeric_limits<int>::max(),
0U};
const rcl_interfaces::msg::FloatingPointRange PowerControllerServices::valid_retract_range_ =
rcl_interfaces::msg::FloatingPointRange()
.set__from_value(0.4F)
Expand Down
14 changes: 14 additions & 0 deletions buoy_gazebo/worlds/mbari_wec.sdf.em
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,24 @@ try:
except NameError:
physics_rtf = 1.0 # not defined so default

# Check if lat_lon was passed in via empy
try:
lat_lon
except NameError:
lat_lon = [36.743850, -121.876233] # not defined so default

}@
<sdf version="1.8">
<world name="mbari_wec_world">

<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<world_frame_orientation>ENU</world_frame_orientation>
<latitude_deg>@(lat_lon[0])</latitude_deg>
<longitude_deg>@(lat_lon[1])</longitude_deg>
<elevation>0.0</elevation>
</spherical_coordinates>

<physics name="step" type="ignored">
<max_step_size>@(physics_step)</max_step_size>
<real_time_factor>@(physics_rtf)</real_time_factor>
Expand Down
4 changes: 2 additions & 2 deletions buoy_tests/launch/pc_commands_ros_feedback_py.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ def test_pc_commands_ros(self, gazebo_test_fixture, proc_info):
retract = 0.75
self.assertNotEqual(self.node.retract_, retract)

# Now send scale command
# Now send retract command
self.node.send_pc_retract_command(retract)
self.assertEqual(self.node.pc_retract_future_.result().result.value,
self.node.pc_retract_future_.result().result.OK)

# Run to let scale process
# Run to let retract process
self.test_helper.run(feedbackCheckIterations)
self.assertTrue(self.test_helper.run_status)
self.assertEqual(preCmdIterations + 4 * feedbackCheckIterations,
Expand Down