Skip to content
This repository was archived by the owner on Jul 22, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 135 commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
82549c8
Initial commit
Yadunund Aug 3, 2020
b221cc1
Added unit tests for PowerSystem
Yadunund Aug 11, 2020
f434cb0
Completed implementation of SystemTraits
Yadunund Aug 12, 2020
9328547
Fixed test
Yadunund Aug 12, 2020
34e4c08
Refactored MechanicalSystem
Yadunund Aug 12, 2020
bbd6e33
Added EstimateBattery
Yadunund Aug 12, 2020
ec6ec27
Moved soc implementation to SimpleBatteryEstimator
Yadunund Aug 18, 2020
ca5ddd9
Debugging soc
Yadunund Aug 18, 2020
ea82351
Debuggin messages
Yadunund Aug 18, 2020
e54d6b3
More debugging
Yadunund Aug 19, 2020
b8dfe02
Initial signs of working discharge model
Yadunund Aug 19, 2020
d601928
Added more tests
Yadunund Aug 19, 2020
acfbdb1
Fixed tests
Yadunund Aug 19, 2020
f38c52d
Removed message printouts
Yadunund Aug 20, 2020
be47d46
Replaced KE with energy for acceleration
Yadunund Aug 20, 2020
73a832e
Added documentation and linted
Yadunund Aug 21, 2020
257ff63
Added CleaningTaskPlanner
Yadunund Aug 21, 2020
6a0a84f
Added CleaningTaskPlanner.cpp and corrected unit test
Yadunund Aug 21, 2020
d7fd00b
Added CleaningTaskPlanner
Yadunund Aug 22, 2020
05ab68d
Added virtual destructor
Yadunund Aug 24, 2020
0f1a1bf
Debugging
Yadunund Aug 24, 2020
8f51274
Fixed test for CleaningTaskPlanner
Yadunund Aug 24, 2020
7d6f9de
More tests
Yadunund Aug 24, 2020
771ef0d
Restructured CMakeLists and fixed warnings
Yadunund Aug 25, 2020
de34ba6
Refactored
Yadunund Aug 27, 2020
a8d214b
Merge branch 'master' into feature/battery_planning
Yadunund Sep 5, 2020
4616684
Setting up rmf_tasks package
aaronchongth Sep 16, 2020
81c5c8e
Basic setup
aaronchongth Sep 17, 2020
934d0bf
AGV state defined and implemented
aaronchongth Sep 17, 2020
d71b508
Request abstract API and derived API for delivery
aaronchongth Sep 18, 2020
1446974
Delivery request estimation implemented
aaronchongth Sep 18, 2020
ccb1721
ChargeBattery request implemented
aaronchongth Sep 18, 2020
c2a4ee2
Using finish_duration instead of finish_time
aaronchongth Sep 21, 2020
12ee027
Switching back to using Time instead of Duration for finish_time
aaronchongth Sep 21, 2020
3fd6724
Migration to using this library is done
aaronchongth Sep 22, 2020
e80a7c5
Increased sim_step to 0.5
Yadunund Sep 23, 2020
1aa471f
Cleaned up unused source files and cmake commands
aaronchongth Sep 23, 2020
78217ce
Merge branch 'feature/battery_planning' into feature/rmf_tasks
aaronchongth Sep 23, 2020
f171713
Initial commit
Yadunund Sep 25, 2020
8bd1550
Started implementation
Yadunund Sep 28, 2020
c392c1c
Completed migration and added toy ptoblem as unit test
Yadunund Sep 29, 2020
5f4aab8
Moved threshold_soc into StateConfig class
Yadunund Sep 29, 2020
510525b
Fixed UB in pop_unassigned
Yadunund Sep 29, 2020
8ff32e8
Fixed UB in Candidates::make()
Yadunund Oct 3, 2020
24a03a8
Updated expand_candidate and implemented correct_assingments() to add…
Yadunund Oct 4, 2020
5a81c8f
Fixed UB in greedy_solve()
Yadunund Oct 6, 2020
cf7562e
estimate_finish() of Delivery checks if robot can return to its charg…
Yadunund Oct 6, 2020
1d01e35
Added Clean request
Yadunund Oct 6, 2020
9f17b57
Cleanup
Yadunund Oct 7, 2020
33e8a84
Using rmf_traffic::agv::Plan::Start for holding waypoint and time inf…
aaronchongth Oct 12, 2020
1145a08
Removed unused efficiency from PowerSystem and added estimate_voltage…
Yadunund Oct 13, 2020
ad9bb28
Merge branch 'feature/battery_planning' into feature/task_planner
Yadunund Oct 13, 2020
268d165
Switched to new BatterySystem API
Yadunund Oct 13, 2020
04707f3
Renamed rmf_tasks to rmf_task
Yadunund Oct 13, 2020
c19713f
Merge branch 'master' into develop/dispatcher_demo
Yadunund Oct 13, 2020
4206f58
Update schedule with docking itinerary (#190)
Yadunund Oct 15, 2020
dff6785
Replaced task_id with request in Assignment
Yadunund Oct 17, 2020
d9e378e
Renamed earliest_start_time to deployment_time in assignment. Modifie…
Yadunund Oct 19, 2020
b1f4dff
TaskPlanner::Configuration no longer takes in a charging request. The…
Yadunund Oct 19, 2020
9006a4b
update msgs for dispatcher (#193)
youliangtan Oct 19, 2020
6da2d9f
Fixed dynamic cast
Yadunund Oct 19, 2020
2efbf3f
Merge branch 'master' into feature/task_planner
Yadunund Oct 19, 2020
5fefd29
Merge branch 'feature/task_planner' into develop/dispatcher_demo
Yadunund Oct 19, 2020
a4c2182
Using magnitude of w and alpha in compute_change_in_charge()
Yadunund Oct 27, 2020
f156b4d
Merge branch 'master' into feature/battery_planning
Yadunund Oct 27, 2020
cacaf1c
Merge branch 'feature/battery_planning' into feature/task_planner
Yadunund Oct 27, 2020
9cb4a31
Fix lifetime of variant_duration variable (#197)
mrushyendra Oct 27, 2020
fb937cb
Added new Clean task, changed TaskProfile and SubmitTask to use expli…
aaronchongth Nov 4, 2020
d6186c3
add eval enum to submit task srv (#201)
youliangtan Nov 5, 2020
69c9b1d
Develop/task planner integration (#199)
Yadunund Nov 5, 2020
5e4a6bb
ChargeBattery task creates WaitForCharge phase with 0.99 max threshol…
Yadunund Nov 5, 2020
febea6d
Added equality constraint in PowerSystem::valid()
Yadunund Nov 6, 2020
90068db
Merge branch 'feature/battery_planning' into feature/task_planner
Yadunund Nov 6, 2020
15cbc5b
Add unit test to detect implicit charging task at the start of Assign…
mrushyendra Nov 6, 2020
4a9ada7
Deal with implicit charging before first assignment (#209)
Yadunund Nov 6, 2020
033de08
Fixed test after merging fix for implicit charging request at start
Yadunund Nov 6, 2020
005e88b
Reduce heuristic overestimation and ignore charging task costs in Tas…
mrushyendra Nov 10, 2020
54e1c32
Loop and Delivery integration with dispatcher framework (#211)
Yadunund Nov 12, 2020
4e833c4
Merge branch 'feature/task_planner' into develop/dispatcher_demo
Yadunund Nov 12, 2020
7ae6fd7
Updated tests after merging in heuristic changes for task planner
Yadunund Nov 12, 2020
cb122b7
Change id field of Request to string and modify TaskPlanner to use in…
mrushyendra Nov 12, 2020
9ccca61
Fixed merge conflicts
Yadunund Nov 12, 2020
d578407
Updated FleetUpdateHandle and Tasks to use string request id
Yadunund Nov 12, 2020
92d3202
Cache estimated values to speed up TaskPlanner (#212)
mrushyendra Nov 16, 2020
15fdae9
few liners to populate start and estimated finish time (#216)
youliangtan Nov 23, 2020
bb363a4
Cleaned up commented code
Yadunund Nov 23, 2020
e5513b1
Merge branch 'develop/dispatcher_demo' of github.com:osrf/rmf_core in…
Yadunund Nov 23, 2020
af7c3ab
Made ChargeBattery ids unique
Yadunund Nov 23, 2020
22c649e
add fleetname to task summary
youliangtan Nov 24, 2020
c516bcd
Debug/task planner candidates (#218)
Yadunund Nov 26, 2020
0f4849e
Updated API documentation in FleetUpdateHandle
Yadunund Nov 26, 2020
fc08b9e
TaskPlanner returns an std::variant (#221)
Yadunund Dec 2, 2020
993fa5d
Automatic retreat for battery recharging (#222)
Yadunund Dec 2, 2020
09d795e
Take into account battery drain while idling in TaskPlanner estimates…
mrushyendra Dec 2, 2020
a34c251
Resolved merge conflict in Adapter.cpp
Yadunund Dec 9, 2020
081306d
Removed commented code from Adapter.cpp
Yadunund Dec 9, 2020
bbd626e
Powersystem does not require string name
Yadunund Dec 11, 2020
d416f83
Added documentation for MechanicalSystem
Yadunund Dec 11, 2020
eb4ac73
Removed BatteryProfile. Switched to make() pattern in rmf_battery
Yadunund Dec 14, 2020
1b9af99
Addressed suggestions for rmf_battery
Yadunund Dec 14, 2020
91d6624
Added account_for_batery_drain()
Yadunund Dec 14, 2020
0688fa5
Added unstable API extension to RobotUpdateHandle
Yadunund Dec 15, 2020
be64e8c
Log error message when battery percentage in RobotState is out of range
Yadunund Dec 15, 2020
e78dd79
Removed TODO in Task and iostream header
Yadunund Dec 15, 2020
b8d61d6
Renamed state() to current_task_end_state() in Robotcontext
Yadunund Dec 15, 2020
ece42e9
TaskManager queue.clear() is protected by mutex
Yadunund Dec 15, 2020
81ee72b
Protected read instances of queue with mutex
Yadunund Dec 15, 2020
d0fcd46
Added warning when robot has insufficient charge to automatically ret…
Yadunund Dec 15, 2020
d907d54
Removed clear_queue() and moved begin_next_task into private
Yadunund Dec 15, 2020
12e5b75
Added TODO to redesign TaskManager
Yadunund Dec 15, 2020
f73f689
Bumped printouts for missing fields to ERROR and other corrections to…
Yadunund Dec 15, 2020
caf6c69
Resolved merge conflict after adding Tow msg
Yadunund Dec 15, 2020
b0402b3
retreat_to_charger() estimates battery drain over all trajectories in…
Yadunund Dec 15, 2020
3e616c9
Battery drain is computed over all trajectories in a generated plan
Yadunund Dec 16, 2020
3f20bb9
Iterate over all trajectories in plan when computing invariant batter…
Yadunund Dec 16, 2020
6b661b0
Rename inertia to moment_of_inertia
Yadunund Dec 17, 2020
ce7c2ab
Added const type specifier and comments for test expectations in rmf_…
Yadunund Dec 17, 2020
51031ae
Use RCLCPP_DEBUG for printing assignments and fix const correctness o…
Yadunund Dec 18, 2020
3beae98
Added TODO to fix request_delivery and request_loop functions in Mock…
Yadunund Dec 18, 2020
17ea62b
Update rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp
Yadunund Dec 18, 2020
1bab060
Update rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp
Yadunund Dec 18, 2020
aaccae9
Update rmf_fleet_adapter/src/rmf_fleet_adapter/agv/FleetUpdateHandle.cpp
Yadunund Dec 18, 2020
697775d
Update rmf_task/include/rmf_task/agv/TaskPlanner.hpp
Yadunund Dec 18, 2020
96bab55
Update rmf_task_msgs/srv/GetTask.srv
Yadunund Dec 18, 2020
13e6125
Update rmf_task_msgs/srv/CancelTask.srv
Yadunund Dec 18, 2020
db40f2a
Fixed CMakeLists.txt and header guards for rmf_task
Yadunund Dec 18, 2020
4d28934
Added setters for other parameters in TaskPlanner Configuration
Yadunund Dec 18, 2020
2ca073b
Removed FilterType from public API. Planner uses Hash type always.
Yadunund Dec 18, 2020
49fdf44
Updated note on friction_coefficient
Yadunund Dec 18, 2020
d3880be
Added documentation for requests and fixed comments
Yadunund Dec 18, 2020
91c9c30
Renamed GetTask to GetTaskList
Yadunund Dec 18, 2020
0f57a10
Renamed GetTask to GetTaskList
Yadunund Dec 18, 2020
1488362
Added set_charger_waypoint() to RobotUpdateHandle
Yadunund Dec 21, 2020
940b66f
Hashing in EstimateCache uses sum not xor
Yadunund Dec 21, 2020
8f2f048
Resolved merge conflict with master
Yadunund Dec 21, 2020
050be4f
Renamed StateConfig to Constraints
Yadunund Dec 22, 2020
29f4a28
Reworked PairHash
Yadunund Dec 22, 2020
f7e5d4b
Corrected shift in PairHash
Yadunund Dec 22, 2020
5889f1d
Return task_planning_constraints by const ref
Yadunund Dec 22, 2020
228db52
Updated Changelogs
Yadunund Jan 4, 2021
2b73ed4
Feature/task dispatcher (#228)
youliangtan Jan 5, 2021
bcba5e7
loop delivery tests for dispatcher (#236)
youliangtan Jan 6, 2021
895e6eb
Merged planner performance
Yadunund Jan 6, 2021
68309b1
Merge branch 'develop/dispatcher_demo' of github.com:osrf/rmf_core in…
Yadunund Jan 7, 2021
89a68c0
Implementation of EstimateCache uses std::mutex object and not shared…
Yadunund Jan 11, 2021
dac010c
add changelog and clean printout logs
youliangtan Jan 13, 2021
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
91 changes: 91 additions & 0 deletions rmf_battery/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
cmake_minimum_required(VERSION 3.5)
project(rmf_battery)

# Default to C++17
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 17)
endif()

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

if(NOT CMAKE_BUILD_TYPE)
# Use the Release build type by default if the user has not specified one
set(CMAKE_BUILD_TYPE Release)
endif()

# set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")

include(GNUInstallDirs)

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(rmf_utils REQUIRED)
find_package(rmf_traffic REQUIRED)
find_package(Eigen3 REQUIRED)

# ===== Battery modelling library
file(GLOB_RECURSE core_lib_srcs "src/rmf_battery/*.cpp")
add_library(rmf_battery SHARED
${core_lib_srcs}
)

target_link_libraries(rmf_battery
PUBLIC
rmf_utils::rmf_utils
rmf_traffic::rmf_traffic
)

target_include_directories(rmf_battery
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
${EIGEN3_INCLUDE_DIRS}
)

ament_export_targets(rmf_battery HAS_LIBRARY_TARGET)
ament_export_dependencies(rmf_utils)

if(BUILD_TESTING)
find_package(ament_cmake_catch2 REQUIRED)

file(GLOB_RECURSE unit_test_srcs "test/*.cpp")

ament_add_catch2(
test_rmf_battery test/main.cpp ${unit_test_srcs}
TIMEOUT 300)
target_link_libraries(test_rmf_battery
rmf_battery
)

target_include_directories(test_rmf_battery
PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/>
)

find_package(rmf_cmake_uncrustify REQUIRED)
find_file(uncrustify_config_file NAMES "share/format/rmf_code_style.cfg")

rmf_uncrustify(
ARGN include src test
CONFIG_FILE ${uncrustify_config_file}
MAX_LINE_LENGTH 80
)
endif()

install(
DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

install(
TARGETS rmf_battery
EXPORT rmf_battery
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)

ament_package()
45 changes: 45 additions & 0 deletions rmf_battery/include/rmf_battery/DevicePowerSink.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2020 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_BATTERY__DEVICEPOWERSINK_HPP
#define RMF_BATTERY__DEVICEPOWERSINK_HPP

namespace rmf_battery {


//==============================================================================
class DevicePowerSink
{
public:

/// Compute change in state-of-charge of the battery due to an onboard
/// device over a time period.
///
/// \param[in] run_time
/// The duration in seconds over which the power system drains charge from
/// the battery
///
/// \return The charge depleted as a fraction of the total battery capacity
virtual double compute_change_in_charge(
const double run_time) const = 0;

virtual ~DevicePowerSink() = default;
};

} // namespace rmf_battery

#endif // RMF_BATTERY__DEVICEPOWERSINK_HPP
47 changes: 47 additions & 0 deletions rmf_battery/include/rmf_battery/MotionPowerSink.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/*
* Copyright (C) 2020 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_BATTERY__MOTIONPOWERSINK_HPP
#define RMF_BATTERY__MOTIONPOWERSINK_HPP

#include <rmf_traffic/Trajectory.hpp>

namespace rmf_battery {


//==============================================================================
class MotionPowerSink
{
public:

/// Compute change in state-of-charge of the battery due to locomotion
/// of the robot along a trajectory.
///
/// \param[in] trajectory
/// A valid rmf_traffic:::Trajectory over which the change in charge has to
/// to be computed
///
/// \return The charge depleted as a fraction of the total battery capacity
virtual double compute_change_in_charge(
const rmf_traffic::Trajectory& trajectory) const = 0;

virtual ~MotionPowerSink() = default;
};

} // namespace rmf_battery

#endif // RMF_BATTERY__MOTIONPOWERSINK_HPP
69 changes: 69 additions & 0 deletions rmf_battery/include/rmf_battery/agv/BatterySystem.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

/*
* Copyright (C) 2020 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_BATTERY__AGV__BATTERYSYSTEM_HPP
#define RMF_BATTERY__AGV__BATTERYSYSTEM_HPP

#include <rmf_utils/impl_ptr.hpp>

#include <optional>

namespace rmf_battery {
namespace agv {

class BatterySystem
{
public:
/// Returns a BatterySystem object if valid values were supplied for the
/// various fields else returns std::nullopt. Here valid implies that the
/// values are greater than zero.
/// \param[in] nominal_voltage
/// The nominal voltage of the battery in Volts
///
/// \param[in] capacity
/// The nominal capacity of the battery in Ampere-hours
///
/// \param[in] charging_current
/// The rated current in Amperes for charging the battery
static std::optional<BatterySystem> make(
double nominal_voltage,
double capacity,
double charging_current);

/// Get the nominal voltage of this battery system
double nominal_voltage() const;

/// Get the capacity of this battery system
double capacity() const;

/// Get the charging current of this battery system
double charging_current() const;

class Implementation;
private:
BatterySystem();
rmf_utils::impl_ptr<Implementation> _pimpl;
};

using BatterySystemPtr = std::shared_ptr<BatterySystem>;
using ConstBatterySystemPtr = std::shared_ptr<const BatterySystem>;

} // namespace agv
} // namespace rmf_battery

#endif // RMF_BATTERY__AGV__BATTERYSYSTEM_HPP
74 changes: 74 additions & 0 deletions rmf_battery/include/rmf_battery/agv/MechanicalSystem.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
/*
* Copyright (C) 2020 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_BATTERY__AGV__MECHANICALSYSTEM_HPP
#define RMF_BATTERY__AGV__MECHANICALSYSTEM_HPP

#include <rmf_utils/impl_ptr.hpp>

#include <optional>

namespace rmf_battery {
namespace agv {

class MechanicalSystem
{
public:

/// Returns a MechanicalSystem object if valid values were supplied for the
/// various fields else returns std::nullopt. Here valid implies that the
/// values are greater than zero.
/// \param[in] mass
/// The mass of the robot in Kilograms(kg)
///
/// \param[in] moment_of_inertia
/// The moment of inertia of the robot along its yaw axis in kg.m^2
///
/// \param[in] friction_coefficient
/// The coefficient of kinetic friction or rolling resistance coefficient
/// measured at the wheels of the robot. This value is used to compute the
/// energy loss due to rotation of the vehicle's wheels during locomotion.
/// This value is the dimensionless constant Crr as described in the
/// reference below.
/// Ref: https://en.wikipedia.org/wiki/Rolling_resistance#Rolling_resistance_coefficient
static std::optional<MechanicalSystem> make(
double mass,
double moment_of_inertia,
double friction_coefficient);

/// Get the mass of this mechanical system
double mass() const;

/// Get the moment of inertia of this mechanical system
double moment_of_inertia() const;

/// Get the friction coefficient of this mechanical system
double friction_coefficient() const;
Comment thread
mxgrey marked this conversation as resolved.

class Implementation;
private:
MechanicalSystem();
rmf_utils::impl_ptr<Implementation> _pimpl;
};

using MechanicalSystemPtr = std::shared_ptr<MechanicalSystem>;
using ConstMechanicalSystemPtr = std::shared_ptr<const MechanicalSystem>;

} // namespace agv
} // namespace rmf_battery

#endif // RMF_BATTERY__AGV__MECHANICALSYSTEM_HPP
55 changes: 55 additions & 0 deletions rmf_battery/include/rmf_battery/agv/PowerSystem.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Copyright (C) 2020 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

#ifndef RMF_BATTERY__AGV__POWERSYSTEM_HPP
#define RMF_BATTERY__AGV__POWERSYSTEM_HPP

#include <rmf_utils/impl_ptr.hpp>

#include <optional>

namespace rmf_battery {
namespace agv {


class PowerSystem
{
public:

/// Returns a PowerSystem object if valid values were supplied for the
/// various fields else returns std::nullopt. Here valid implies that the
/// values are greater than zero.
/// \param[in] nominal_power
/// The rated nominal power consumption in Watts for this power system
static std::optional<PowerSystem> make(double nominal_power);

/// Get the nominal power of this power system
double nominal_power() const;

class Implementation;
private:
PowerSystem();
rmf_utils::impl_ptr<Implementation> _pimpl;
};

using PowerSystemPtr = std::shared_ptr<PowerSystem>;
using ConstPowerSystemPtr = std::shared_ptr<const PowerSystem>;

} // namespace agv
} // namespace rmf_battery

#endif // RMF_BATTERY__AGV__POWERSYSTEM_HPP
Loading