Skip to content

Commit

Permalink
Merge pull request #2 from OUXT-Polaris/feature/document_generator
Browse files Browse the repository at this point in the history
add doxygen comment
  • Loading branch information
hakuturu583 committed Jul 16, 2020
2 parents 770bf90 + ea6a603 commit 89539cc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/ROS2-Eloquent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ jobs:
- name: Install dependencies
run: |
source /opt/ros/eloquent/setup.bash
sudo apt install -y python-rosdep
sudo apt install -y python-rosdep python3-vcstool
sudo rosdep init
rosdep update
cd ~/ros2_ws
vcs import src < src/color_names/dependency.repos
cd ~/ros2_ws/src
rosdep install -r -y --from-paths . --ignore-src
- name: Build packages
Expand Down
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_msgs REQUIRED)
find_package(visualization_msgs REQUIRED)
find_package(document_generator REQUIRED)
include("${document_generator_DIR}/doxygen.cmake")

include_directories(
include
Expand All @@ -34,6 +36,7 @@ ament_target_dependencies(color_names
rclcpp
std_msgs
)
add_document(color_names)
ament_export_interfaces(export_color_names HAS_LIBRARY_TARGET)
ament_export_libraries(color_names)

Expand All @@ -46,6 +49,7 @@ ament_target_dependencies(view_all
std_msgs
visualization_msgs
)
add_document(view_all)

install(TARGETS
view_all
Expand Down
5 changes: 5 additions & 0 deletions dependency.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
document_generator:
type: git
url: https://github.com/OUXT-Polaris/document_generator.git
version: master
1 change: 1 addition & 0 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<depend>std_msgs</depend>
<depend>visualization_msgs</depend>
<depend>rviz2</depend>
<depend>document_generator</depend>

<!-- The export tag contains other, unspecified, tags -->
<export>
Expand Down
14 changes: 14 additions & 0 deletions src/color_names.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@

namespace color_names
{
/**
* @brief generate std_msgs::msg::ColorRGBA message from hsv values
* @param h hue
* @param s saturation
* @param v value
* @param alpha alpha value of the color
* @return std_msgs::msg::ColorRGBA
*/
std_msgs::msg::ColorRGBA fromHsv(double h, double s, double v, double alpha)
{
std_msgs::msg::ColorRGBA color;
Expand Down Expand Up @@ -49,6 +57,12 @@ std_msgs::msg::ColorRGBA fromHsv(double h, double s, double v, double alpha)
return color;
}

/**
* @brief generate std_msgs::msg::ColorRGBA message from color name
* @param preset_name the name of the color
* @param alpha alpha value of the color
* @return std_msgs::msg::ColorRGBA
*/
std_msgs::msg::ColorRGBA makeColorMsg(std::string preset_name, double alpha)
{
std_msgs::msg::ColorRGBA c_msg;
Expand Down

0 comments on commit 89539cc

Please sign in to comment.