Skip to content
Open
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
47 changes: 26 additions & 21 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(power_msgs)

find_package(catkin REQUIRED
COMPONENTS
message_generation
std_msgs
)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

add_message_files(
FILES
BatteryState.msg
BreakerState.msg
)
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

add_service_files(
FILES
BreakerCommand.srv
)
# find dependencies
find_package(ament_cmake REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(std_msgs REQUIRED)

generate_messages(DEPENDENCIES std_msgs)
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/BatteryState.msg"
"msg/BreakerState.msg"
"srv/BreakerCommand.srv"
DEPENDENCIES builtin_interfaces std_msgs)

catkin_package(
CATKIN_DEPENDS
message_runtime
std_msgs
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
ament_lint_auto_find_test_dependencies()
endif()

ament_export_dependencies(rosidl_default_runtime)

ament_package()
2 changes: 1 addition & 1 deletion msg/BatteryState.msg
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ bool is_charging
# When charging, this is the remaining time until fully charged.
# When discharging, this is the time until battery is empty.
# Non-zero values are considered valid.
duration remaining_time
builtin_interfaces/Duration remaining_time

# Total capacity of battery
float32 total_capacity
Expand Down
24 changes: 18 additions & 6 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<package>
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>power_msgs</name>
<version>0.4.1</version>
<description>
Expand All @@ -14,12 +16,22 @@

<license>BSD</license>
<url>http://ros.org/wiki/power_msgs</url>

<buildtool_depend>catkin</buildtool_depend>

<buildtool_depend>ament_cmake</buildtool_depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>

<build_depend>builtin_interfaces</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>message_generation</build_depend>

<run_depend>std_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<exec_depend>builtin_interfaces</exec_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<exec_depend>std_msgs</exec_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<member_of_group>rosidl_interface_packages</member_of_group>
<export>
<build_type>ament_cmake</build_type>
</export>
</package>