Porto to Melodic. melodic
authorWalter Fetter Lages <w.fetter@ieee.org>
Tue, 8 Sep 2020 04:41:47 +0000 (01:41 -0300)
committerWalter Fetter Lages <w.fetter@ieee.org>
Tue, 8 Sep 2020 04:41:47 +0000 (01:41 -0300)
CMakeLists.txt
package.xml
src/circle_path.cpp
src/eight_path.cpp

index bca23a4..2ac148f 100644 (file)
@@ -1,16 +1,20 @@
 cmake_minimum_required(VERSION 2.8.3)
 project(pose2d_trajectories)
 
+## Compile as C++11, supported in ROS Kinetic and newer
+# add_compile_options(-std=c++11)
+
 ## Find catkin macros and libraries
 ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
 ## is used, also find other catkin packages
-find_package(catkin REQUIRED COMPONENTS roscpp)
-
-find_package(cmake_modules REQUIRED)
+find_package(catkin REQUIRED COMPONENTS
+  geometry_msgs
+  roscpp
+)
 
 ## System dependencies are found with CMake's conventions
 # find_package(Boost REQUIRED COMPONENTS system)
-find_package(Eigen REQUIRED)
+find_package(Eigen3 REQUIRED)
 
 
 ## Uncomment this if the package has a setup.py. This macro ensures
@@ -27,11 +31,11 @@ find_package(Eigen REQUIRED)
 ## * Let MSG_DEP_SET be the set of packages whose message types you use in
 ##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
 ## * In the file package.xml:
-##   * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
-##   * If MSG_DEP_SET isn't empty the following dependencies might have been
-##     pulled in transitively but can be declared for certainty nonetheless:
-##     * add a build_depend tag for "message_generation"
-##     * add a run_depend tag for "message_runtime"
+##   * add a build_depend tag for "message_generation"
+##   * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
+##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
+##     but can be declared for certainty nonetheless:
+##     * add a exec_depend tag for "message_runtime"
 ## * In this file (CMakeLists.txt):
 ##   * add "message_generation" and every package in MSG_DEP_SET to
 ##     find_package(catkin REQUIRED COMPONENTS ...)
@@ -66,7 +70,27 @@ find_package(Eigen REQUIRED)
 ## Generate added messages and services with any dependencies listed here
 # generate_messages(
 #   DEPENDENCIES
-#   std_msgs  # Or other packages containing msgs
+#   geometry_msgs
+# )
+
+################################################
+## Declare ROS dynamic reconfigure parameters ##
+################################################
+
+## To declare and build dynamic reconfigure parameters within this
+## package, follow these steps:
+## * In the file package.xml:
+##   * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
+## * In this file (CMakeLists.txt):
+##   * add "dynamic_reconfigure" to
+##     find_package(catkin REQUIRED COMPONENTS ...)
+##   * uncomment the "generate_dynamic_reconfigure_options" section below
+##     and list every .cfg file to be processed
+
+## Generate dynamic reconfigure parameters in the 'cfg' folder
+# generate_dynamic_reconfigure_options(
+#   cfg/DynReconf1.cfg
+#   cfg/DynReconf2.cfg
 # )
 
 ###################################
@@ -74,15 +98,15 @@ find_package(Eigen REQUIRED)
 ###################################
 ## The catkin_package macro generates cmake config files for your package
 ## Declare things to be passed to dependent projects
-## INCLUDE_DIRS: uncomment this if you package contains header files
+## INCLUDE_DIRS: uncomment this if your package contains header files
 ## LIBRARIES: libraries you create in this project that dependent projects also need
 ## CATKIN_DEPENDS: catkin_packages dependent projects also need
 ## DEPENDS: system dependencies of this project that dependent projects also need
 catkin_package(
   INCLUDE_DIRS include
-  LIBRARIES ${PROJECT_NAME}
-#  CATKIN_DEPENDS other_catkin_pkg
-  DEPENDS eigen
+  LIBRARIES pose2d_trajectories
+#  CATKIN_DEPENDS geometry_msgs roscpp
+  DEPENDS EIGEN3
 )
 
 ###########
@@ -91,43 +115,56 @@ catkin_package(
 
 ## Specify additional locations of header files
 ## Your package locations should be listed before other locations
-# include_directories(include)
-# TODO: Check names of system library include directories (eigen)
 include_directories(
-  include ${catkin_INCLUDE_DIRS}
-  ${Eigen_INCLUDE_DIRS}
+ include
+  ${catkin_INCLUDE_DIRS}
+# TODO: Check names of system library include directories (Eigen3)
+  ${EIGEN3_INCLUDE_DIRS}
 )
 
-## Declare a cpp library
+## Declare a C++ library
 add_library(${PROJECT_NAME}
    src/circle_path.cpp
    src/eight_path.cpp
 )
 
-## Declare a cpp executable
+## Add cmake target dependencies of the library
+## as an example, code may need to be generated before libraries
+## either from message generation or dynamic reconfigure
+# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
+
+## Declare a C++ executable
+## With catkin_make all packages are built within a single CMake context
+## The recommended prefix ensures that target names across packages don't collide
 add_executable(eight_trajectory src/eight_trajectory.cpp)
 add_executable(pose2d_stamp src/pose2d_stamp.cpp)
 
-## Add cmake target dependencies of the executable/library
-## as an example, message headers may need to be generated before nodes
-# add_dependencies(pose2d_trajectories_node pose2d_trajectories_generate_messages_cpp)
+## Rename C++ executable without prefix
+## The above recommended prefix causes long target names, the following renames the
+## target back to the shorter version for ease of user use
+## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
+# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
+
+## Add cmake target dependencies of the executable
+## same as for the library above
+# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
 
 ## Specify libraries to link a library or executable target against
 target_link_libraries(${PROJECT_NAME}
-  ${catkin_LIBRARIES}
-  ${eigen_LIBRARIES}
+   ${catkin_LIBRARIES}
+#   ${Eigen3_LIBRARIES}
 )
 
 target_link_libraries(eight_trajectory
   ${catkin_LIBRARIES}
-  ${eigen_LIBRARIES}
-  ${PROJECT_NAME}
+   ${PROJECT_NAME}
 )
 
 target_link_libraries(pose2d_stamp
   ${catkin_LIBRARIES}
 )
 
+
 #############
 ## Install ##
 #############
@@ -143,7 +180,7 @@ target_link_libraries(pose2d_stamp
 # )
 
 ## Mark executables and/or libraries for installation
-install(TARGETS ${PROJECT_NAME}
+ install(TARGETS ${PROJECT_NAME}
    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
index e1b2664..08b7459 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0"?>
-<package>
+<package format="2">
   <name>pose2d_trajectories</name>
-  <version>3.0.0</version>
+  <version>3.1.0</version>
   <description>The pose2d_trajectories package</description>
 
-  <!-- One maintainer tag required, multiple allowed, one person per tag --> 
+  <!-- One maintainer tag required, multiple allowed, one person per tag -->
   <!-- Example:  -->
   <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
   <maintainer email="fetter@ece.ufrgs.br">Walter Fetter Lages</maintainer>
   <license>GPLv3</license>
 
 
-  <!-- Url tags are optional, but mutiple are allowed, one per tag -->
+  <!-- Url tags are optional, but multiple are allowed, one per tag -->
   <!-- Optional attribute type can be: website, bugtracker, or repository -->
   <!-- Example: -->
-  <!-- <url type="website">http://wiki.ros.org/twil_ident</url> -->
+  <!-- <url type="website">http://wiki.ros.org/pose2d_trajectories</url> -->
 
 
-  <!-- Author tags are optional, mutiple are allowed, one per tag -->
-  <!-- Authors do not have to be maintianers, but could be -->
+  <!-- Author tags are optional, multiple are allowed, one per tag -->
+  <!-- Authors do not have to be maintainers, but could be -->
   <!-- Example: -->
   <!-- <author email="jane.doe@example.com">Jane Doe</author> -->
   <author email="fetter@ece.ufrgs.br">Walter Fetter Lages</author>
 
 
-  <!-- The *_depend tags are used to specify dependencies -->
+  <!-- The *depend tags are used to specify dependencies -->
   <!-- Dependencies can be catkin packages or system dependencies -->
   <!-- Examples: -->
+  <!-- Use depend as a shortcut for packages that are both build and exec dependencies -->
+  <!--   <depend>roscpp</depend> -->
+  <!--   Note that this is equivalent to the following: -->
+  <!--   <build_depend>roscpp</build_depend> -->
+  <!--   <exec_depend>roscpp</exec_depend> -->
   <!-- Use build_depend for packages you need at compile time: -->
   <!--   <build_depend>message_generation</build_depend> -->
+  <!-- Use build_export_depend for packages you need in order to build against this package: -->
+  <!--   <build_export_depend>message_generation</build_export_depend> -->
   <!-- Use buildtool_depend for build tool packages: -->
   <!--   <buildtool_depend>catkin</buildtool_depend> -->
-  <!-- Use run_depend for packages you need at runtime: -->
-  <!--   <run_depend>message_runtime</run_depend> -->
+  <!-- Use exec_depend for packages you need at runtime: -->
+  <!--   <exec_depend>message_runtime</exec_depend> -->
   <!-- Use test_depend for packages you need only for testing: -->
   <!--   <test_depend>gtest</test_depend> -->
+  <!-- Use doc_depend for packages you need only for building documentation: -->
+  <!--   <doc_depend>doxygen</doc_depend> -->
   <buildtool_depend>catkin</buildtool_depend>
-  <build_depend>eigen</build_depend>
+  <build_depend>Eigen3</build_depend>
   <build_depend>geometry_msgs</build_depend>
-  
-  <run_depend>eigen</run_depend>
-  <run_depend>geometry_msgs</run_depend>
+  <build_depend>roscpp</build_depend>
+  <build_export_depend>Eigen3</build_export_depend>
+  <build_export_depend>geometry_msgs</build_export_depend>
+  <build_export_depend>roscpp</build_export_depend>
+  <exec_depend>Eigen3</exec_depend>
+  <exec_depend>geometry_msgs</exec_depend>
+  <exec_depend>roscpp</exec_depend>
+
 
   <!-- The export tag contains other, unspecified, tags -->
   <export>
-    <!-- You can specify that this package is a metapackage here: -->
-    <!-- <metapackage/> -->
-
     <!-- Other tools can request additional information be placed here -->
 
   </export>
index 9899cb5..df5f920 100644 (file)
@@ -21,8 +21,8 @@
 
 #include <pose2d_trajectories/circle_path.h>
 
-#define sqr(x) (x*x)
-#define sgn(x) ((x == 0.0)? 0.0:(x/fabs(x)))
+#define sqr(x) ((x)*(x))
+#define sgn(x) (((x) == 0.0)? 0.0:((x)/fabs(x)))
 
 CirclePath::CirclePath(const Eigen::Vector2d &pc,double phi0,double r,double w)
 {
index fec44df..02326e4 100644 (file)
@@ -21,7 +21,7 @@
 
 #include <pose2d_trajectories/eight_path.h>
 
-#define sgn(x) ((x == 0.0)? 0.0:(x/fabs(x)))
+#define sgn(x) (((x) == 0.0)? 0.0:((x)/fabs(x)))
 
 EightPath::EightPath(const Eigen::Vector2d &pc,double r,double w):
 c1_(Eigen::Vector2d(pc[0],pc[1]+r),-M_PI_2*sgn(w),r,w),