-
Notifications
You must be signed in to change notification settings - Fork 232
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Redo table of contents to break into sidebar sections * ROS2 versions of session 1 pages, ROS1 content moved to 'Legacy' section * Port of session 2 material * Added intro text on landing page and moved ROS1 content to dedicated legacy page * Added numeric prefixes to file names for sorting in the filesystem * Change ROS2 version from Dashing to Eloquent * Fixed some bugs/problems after a run-through * Added ROS1 and ROS2 versions of exercise solutions * Point Travis back to ROS1 exercises * Note about background for session 3 * Fix incorrent includes * Fix missing include * Fix another include * Fix typo * Update launch files to Foxy API * Update eloquent references to foxy * Minor clean-up prior to ROS2 PR merge - update PC Setup page and install/check scripts - add wait_for_service - sync exercise references to better match instructions Co-authored-by: Jeremy Zoss <jzoss@swri.org>
- Loading branch information
1 parent
2f9a489
commit 85f3034
Showing
97 changed files
with
2,455 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(myworkcell_core) | ||
|
||
# Default to C99 | ||
if(NOT CMAKE_C_STANDARD) | ||
set(CMAKE_C_STANDARD 99) | ||
endif() | ||
|
||
# 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(rclcpp REQUIRED) | ||
|
||
# The vision_node executable | ||
add_executable(vision_node src/vision_node.cpp) | ||
ament_target_dependencies(vision_node rclcpp) | ||
|
||
# Mark executables and/or libraries for installation | ||
install(TARGETS vision_node | ||
ARCHIVE DESTINATION lib/${PROJECT_NAME} | ||
LIBRARY DESTINATION lib/${PROJECT_NAME} | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
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_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?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>myworkcell_core</name> | ||
<version>0.0.0</version> | ||
<description>TODO: Package description</description> | ||
<maintainer email="me@rosindustrial.com">ROS-Industrial</maintainer> | ||
<license>TODO: License declaration</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<depend>rclcpp</depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>ament_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
15 changes: 15 additions & 0 deletions
15
exercises/1.3/ros2/src/myworkcell_core/src/vision_node.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <rclcpp/rclcpp.hpp> | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
// This must be called before anything else ROS-related | ||
rclcpp::init(argc, argv); | ||
|
||
// Create a ROS node | ||
auto node = std::make_shared<rclcpp::Node>("vision_node"); | ||
|
||
RCLCPP_INFO(node->get_logger(), "Hello, World!"); | ||
|
||
// Don't exit the program. | ||
rclcpp::spin(node); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(myworkcell_core) | ||
|
||
# Default to C99 | ||
if(NOT CMAKE_C_STANDARD) | ||
set(CMAKE_C_STANDARD 99) | ||
endif() | ||
|
||
# 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(rclcpp REQUIRED) | ||
find_package(fake_ar_publisher REQUIRED) | ||
|
||
# The vision_node executable | ||
add_executable(vision_node src/vision_node.cpp) | ||
ament_target_dependencies(vision_node rclcpp fake_ar_publisher) | ||
|
||
# Mark executables and/or libraries for installation | ||
install(TARGETS vision_node | ||
ARCHIVE DESTINATION lib/${PROJECT_NAME} | ||
LIBRARY DESTINATION lib/${PROJECT_NAME} | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
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_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?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>myworkcell_core</name> | ||
<version>0.0.0</version> | ||
<description>TODO: Package description</description> | ||
<maintainer email="me@rosindustrial.com">ROS-Industrial</maintainer> | ||
<license>TODO: License declaration</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<depend>rclcpp</depend> | ||
<depend>fake_ar_publisher</depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>ament_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
40 changes: 40 additions & 0 deletions
40
exercises/1.4/ros2/src/myworkcell_core/src/vision_node.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <rclcpp/rclcpp.hpp> | ||
#include <fake_ar_publisher/msg/ar_marker.hpp> | ||
|
||
class Localizer : public rclcpp::Node | ||
{ | ||
public: | ||
Localizer() : Node("vision_node"), last_msg_{nullptr} | ||
{ | ||
ar_sub_ = this->create_subscription<fake_ar_publisher::msg::ARMarker>( | ||
"ar_pose_marker", | ||
rclcpp::QoS(1), | ||
std::bind(&Localizer::visionCallback, this, std::placeholders::_1)); | ||
} | ||
|
||
void visionCallback(fake_ar_publisher::msg::ARMarker::SharedPtr msg) | ||
{ | ||
last_msg_ = msg; | ||
RCLCPP_INFO(get_logger(), "Received pose: x=%f, y=%f, z=%f", | ||
msg->pose.pose.position.x, | ||
msg->pose.pose.position.y, | ||
msg->pose.pose.position.z); | ||
} | ||
|
||
rclcpp::Subscription<fake_ar_publisher::msg::ARMarker>::SharedPtr ar_sub_; | ||
fake_ar_publisher::msg::ARMarker::SharedPtr last_msg_; | ||
}; | ||
|
||
int main(int argc, char* argv[]) | ||
{ | ||
// This must be called before anything else ROS-related | ||
rclcpp::init(argc, argv); | ||
|
||
// The Localizer class provides this node's ROS interfaces | ||
auto node = std::make_shared<Localizer>(); | ||
|
||
RCLCPP_INFO(node->get_logger(), "Vision node starting"); | ||
|
||
// Don't exit the program. | ||
rclcpp::spin(node); | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
cmake_minimum_required(VERSION 3.5) | ||
project(myworkcell_core) | ||
|
||
# Default to C99 | ||
if(NOT CMAKE_C_STANDARD) | ||
set(CMAKE_C_STANDARD 99) | ||
endif() | ||
|
||
# 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(rclcpp REQUIRED) | ||
find_package(fake_ar_publisher REQUIRED) | ||
|
||
# Interface generation dependencies | ||
find_package(geometry_msgs REQUIRED) | ||
find_package(rosidl_default_generators REQUIRED) | ||
|
||
rosidl_generate_interfaces(${PROJECT_NAME} | ||
"srv/LocalizePart.srv" | ||
DEPENDENCIES geometry_msgs | ||
) | ||
|
||
# The vision_node executable | ||
add_executable(vision_node src/vision_node.cpp) | ||
ament_target_dependencies(vision_node rclcpp fake_ar_publisher) | ||
rosidl_target_interfaces(vision_node ${PROJECT_NAME} "rosidl_typesupport_cpp") | ||
|
||
# The myworkcell_node executable | ||
add_executable(myworkcell_node src/myworkcell_node.cpp) | ||
ament_target_dependencies(myworkcell_node rclcpp) | ||
rosidl_target_interfaces(myworkcell_node ${PROJECT_NAME} "rosidl_typesupport_cpp") | ||
|
||
# Mark executables and/or libraries for installation | ||
install(TARGETS vision_node myworkcell_node | ||
ARCHIVE DESTINATION lib/${PROJECT_NAME} | ||
LIBRARY DESTINATION lib/${PROJECT_NAME} | ||
RUNTIME DESTINATION lib/${PROJECT_NAME} | ||
) | ||
|
||
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_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?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>myworkcell_core</name> | ||
<version>0.0.0</version> | ||
<description>TODO: Package description</description> | ||
<maintainer email="me@rosindustrial.com">ROS-Industrial</maintainer> | ||
<license>TODO: License declaration</license> | ||
<member_of_group>rosidl_interface_packages</member_of_group> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<build_depend>rosidl_default_generators</build_depend> | ||
<exec_depend>rosidl_default_runtime</exec_depend> | ||
<depend>geometry_msgs</depend> | ||
|
||
<depend>rclcpp</depend> | ||
<depend>fake_ar_publisher</depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>ament_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
Oops, something went wrong.