Skip to content

Commit

Permalink
Merge pull request #158 from KumarRobotics/devel/humble_pranav
Browse files Browse the repository at this point in the history
Translate kr_tracker_msgs and kr_mav_msgs into ROS2
  • Loading branch information
fcladera authored Feb 16, 2024
2 parents 6227a26 + d8b9dfb commit a11c87d
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 89 deletions.
57 changes: 32 additions & 25 deletions kr_mav_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,34 +1,41 @@
cmake_minimum_required(VERSION 3.10)
project(kr_mav_msgs)

# set default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

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

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

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(Eigen3 REQUIRED)

add_message_files(
DIRECTORY
msg
FILES
AuxCommand.msg
Corrections.msg
MotorRPM.msg
OutputData.msg
PWMCommand.msg
PositionCommand.msg
SO3Command.msg
Serial.msg
StatusData.msg
TRPYCommand.msg)
find_package(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/AuxCommand.msg"
"msg/Corrections.msg"
"msg/MotorRPM.msg"
"msg/OutputData.msg"
"msg/PositionCommand.msg"
"msg/PWMCommand.msg"
"msg/Serial.msg"
"msg/SO3Command.msg"
"msg/StatusData.msg"
"msg/TRPYCommand.msg"
DEPENDENCIES builtin_interfaces std_msgs geometry_msgs
)

generate_messages(DEPENDENCIES geometry_msgs)
ament_export_dependencies(rosidl_default_runtime)

catkin_package(
CATKIN_DEPENDS
geometry_msgs
message_runtime
DEPENDS
EIGEN3)
ament_package()
2 changes: 1 addition & 1 deletion kr_mav_msgs/msg/MotorRPM.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Header header
std_msgs/Header header
uint8 motor_count
int16[8] rpm
2 changes: 1 addition & 1 deletion kr_mav_msgs/msg/OutputData.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Header header
std_msgs/Header header
uint16 loop_rate
float64 voltage
geometry_msgs/Quaternion orientation
Expand Down
2 changes: 1 addition & 1 deletion kr_mav_msgs/msg/PWMCommand.msg
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Header header
std_msgs/Header header
# pwm values should be between 0 (1ms pulse width) and 1 (2ms pulse width)
float64[2] pwm
2 changes: 1 addition & 1 deletion kr_mav_msgs/msg/PositionCommand.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Header header
std_msgs/Header header
geometry_msgs/Point position
geometry_msgs/Vector3 velocity
geometry_msgs/Vector3 acceleration
Expand Down
6 changes: 3 additions & 3 deletions kr_mav_msgs/msg/SO3Command.msg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Header header
std_msgs/Header header
geometry_msgs/Vector3 force
geometry_msgs/Quaternion orientation
geometry_msgs/Vector3 angular_velocity
kr_mav_msgs/AuxCommand aux
float64[3] kR
float64[3] kOm
float64[3] kr
float64[3] kom
2 changes: 1 addition & 1 deletion kr_mav_msgs/msg/Serial.msg
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ uint8 PWM_CMD = 119 # 'w' in base 10
uint8 STATUS_DATA = 99 # 'c' in base 10
uint8 OUTPUT_DATA = 100 # 'd' in base 10

Header header
std_msgs/Header header
uint8 channel
uint8 type # One of the types listed above
uint8[] data
2 changes: 1 addition & 1 deletion kr_mav_msgs/msg/StatusData.msg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Header header
std_msgs/Header header
uint16 loop_rate
float64 voltage
uint8 seq
6 changes: 3 additions & 3 deletions kr_mav_msgs/msg/TRPYCommand.msg
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Header header
std_msgs/Header header
float64 thrust
float64 roll
float64 pitch
float64 yaw
geometry_msgs/Vector3 angular_velocity
float64[3] kR
float64[3] kOm
float64[3] kr
float64[3] kom
kr_mav_msgs/AuxCommand aux
21 changes: 15 additions & 6 deletions kr_mav_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,28 @@
<package format="2">
<package format="3">
<name>kr_mav_msgs</name>
<version>1.0.0</version>
<description>kr_mav_msgs</description>
<maintainer email="[email protected]">Kartik Mohta</maintainer>
<maintainer email="[email protected]">Michael Watterson</maintainer>
<maintainer email="[email protected]">Justin Thomas</maintainer>
<maintainer email="[email protected]">Kashish Garg</maintainer>

<license>BSD</license>

<author>Kartik Mohta</author>

<buildtool_depend>catkin</buildtool_depend>

<buildtool_depend>rosidl_default_generators</buildtool_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>

<depend>std_msgs</depend>
<depend>geometry_msgs</depend>
<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
<depend>action_msgs</depend>

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

<export>
<build_type>ament_cmake</build_type>
</export>

</package>
82 changes: 49 additions & 33 deletions trackers/kr_tracker_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,54 @@
cmake_minimum_required(VERSION 3.10)
project(kr_tracker_msgs)

# set default build type
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
# Default to C99
if(NOT CMAKE_C_STANDARD)
set(CMAKE_C_STANDARD 99)
endif()

find_package(catkin REQUIRED COMPONENTS message_generation nav_msgs geometry_msgs actionlib_msgs)

add_service_files(DIRECTORY srv FILES Transition.srv)

add_action_files(
DIRECTORY
action
FILES
LineTracker.action
VelocityTracker.action
CircleTracker.action
TrajectoryTracker.action
LissajousTracker.action
LissajousAdder.action)

add_message_files(
DIRECTORY
msg
FILES
TrackerStatus.msg
VelocityGoal.msg)

generate_messages(DEPENDENCIES geometry_msgs actionlib_msgs)

catkin_package(
CATKIN_DEPENDS
nav_msgs
geometry_msgs
actionlib_msgs
message_runtime)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()

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

# find dependencies
find_package(ament_cmake REQUIRED)
find_package(std_msgs REQUIRED)
find_package(builtin_interfaces REQUIRED)
find_package(geometry_msgs REQUIRED)

find_package(rosidl_default_generators REQUIRED)
rosidl_generate_interfaces(${PROJECT_NAME}
"msg/TrackerStatus.msg"
"msg/VelocityGoal.msg"

"srv/Transition.srv"

"action/CircleTracker.action"
"action/LineTracker.action"
"action/LissajousAdder.action"
"action/LissajousTracker.action"
"action/TrajectoryTracker.action"
"action/VelocityTracker.action"

DEPENDENCIES std_msgs builtin_interfaces geometry_msgs
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
# the following line skips the linter which checks for copyrights
# uncomment the line when a copyright and license is not present in all source files
#set(ament_cmake_copyright_FOUND TRUE)
# the following line skips cpplint (only works in a git repo)
# uncomment the line when this package is not in a git repo
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

ament_export_dependencies(rosidl_default_runtime)

ament_package()
8 changes: 4 additions & 4 deletions trackers/kr_tracker_msgs/action/CircleTracker.action
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#goal definition
float64 Ax
float64 Ay
float64 T
float64 ax
float64 ay
float64 t
float64 duration
---
#result definition
Expand All @@ -12,4 +12,4 @@ float64 length
---
#feedback
# time in tracker
float64 duration
float64 duration
4 changes: 2 additions & 2 deletions trackers/kr_tracker_msgs/action/LineTracker.action
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ float64 yaw
float64 v_des
float64 a_des
bool relative
time t_start
duration duration
builtin_interfaces/Time t_start
builtin_interfaces/Duration duration
---
#result definition
# send back goal
Expand Down
23 changes: 16 additions & 7 deletions trackers/kr_tracker_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
<package format="2">
<package format="3">
<name>kr_tracker_msgs</name>
<version>1.0.0</version>
<description>kr_tracker_msgs</description>
<maintainer email="[email protected]">Dinesh Thakur</maintainer>
<maintainer email="[email protected]">Kartik Mohta</maintainer>
<maintainer email="[email protected]">Kashish Garg</maintainer>

<license>BSD</license>

<author>Dinesh Thakur</author>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<depend>nav_msgs</depend>
<buildtool_depend>rosidl_default_generators</buildtool_depend>
<exec_depend>rosidl_default_runtime</exec_depend>
<member_of_group>rosidl_interface_packages</member_of_group>

<depend>action_msgs</depend>
<depend>std_msgs</depend>
<depend>builtin_interfaces</depend>
<depend>geometry_msgs</depend>
<depend>actionlib_msgs</depend>

<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>

0 comments on commit a11c87d

Please sign in to comment.