Rename. Add conga line launch file.
This commit is contained in:
parent
878fc973ac
commit
26ab3c534d
|
|
@ -1,5 +1,5 @@
|
|||
cmake_minimum_required(VERSION 3.8)
|
||||
project(j7s-simple)
|
||||
project(j7s_simple)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
|
|
@ -11,27 +11,29 @@ find_package(rclcpp REQUIRED)
|
|||
find_package(std_msgs REQUIRED)
|
||||
find_package(fmt REQUIRED)
|
||||
|
||||
add_executable(j7s-publisher src/j7s-publisher.cpp)
|
||||
target_include_directories(j7s-publisher PUBLIC
|
||||
add_executable(j7s_publisher src/j7s_publisher.cpp)
|
||||
target_include_directories(j7s_publisher PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
target_compile_features(j7s-publisher PUBLIC c_std_99 cxx_std_17)
|
||||
target_link_libraries(j7s-publisher fmt::fmt)
|
||||
ament_target_dependencies(j7s-publisher rclcpp std_msgs)
|
||||
target_compile_features(j7s_publisher PUBLIC c_std_99 cxx_std_17)
|
||||
target_link_libraries(j7s_publisher fmt::fmt)
|
||||
ament_target_dependencies(j7s_publisher rclcpp std_msgs)
|
||||
|
||||
add_executable(j7s-parrot src/j7s-parrot.cpp)
|
||||
target_include_directories(j7s-parrot PUBLIC
|
||||
add_executable(j7s_parrot src/j7s_parrot.cpp)
|
||||
target_include_directories(j7s_parrot PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>)
|
||||
target_compile_features(j7s-parrot PUBLIC c_std_99 cxx_std_17)
|
||||
target_link_libraries(j7s-parrot fmt::fmt)
|
||||
ament_target_dependencies(j7s-parrot rclcpp std_msgs)
|
||||
target_compile_features(j7s_parrot PUBLIC c_std_99 cxx_std_17)
|
||||
target_link_libraries(j7s_parrot fmt::fmt)
|
||||
ament_target_dependencies(j7s_parrot rclcpp std_msgs)
|
||||
|
||||
install(DIRECTORY
|
||||
launch
|
||||
DESTINATION share/${PROJECT_NAME}/
|
||||
)
|
||||
install(TARGETS j7s-publisher j7s-parrot
|
||||
install(TARGETS
|
||||
j7s_publisher
|
||||
j7s_parrot
|
||||
DESTINATION lib/${PROJECT_NAME})
|
||||
|
||||
ament_package()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
import launch
|
||||
import launch_ros.actions
|
||||
|
||||
def generate_launch_description():
|
||||
parrots = []
|
||||
for i in range(1, 10):
|
||||
parrots.append(make_parrot(i))
|
||||
|
||||
return launch.LaunchDescription(parrots)
|
||||
|
||||
|
||||
def make_parrot(index):
|
||||
index_before = index - 1
|
||||
parrot = launch_ros.actions.Node(
|
||||
package='j7s_simple',
|
||||
executable='j7s_parrot',
|
||||
name='j7s_parrot_{}'.format(index),
|
||||
parameters=[{
|
||||
"name":"{}".format(index)
|
||||
}],
|
||||
remappings=[
|
||||
("~/parrot_in", "parrot_{}".format(index_before)),
|
||||
("~/parrot_out", "parrot_{}".format(index))
|
||||
]
|
||||
)
|
||||
return parrot
|
||||
|
|
@ -3,16 +3,16 @@ import launch_ros.actions
|
|||
|
||||
def generate_launch_description():
|
||||
publisher_node = launch_ros.actions.Node(
|
||||
package='j7s-simple',
|
||||
executable='j7s-publisher',
|
||||
package='j7s_simple',
|
||||
executable='j7s_publisher',
|
||||
name='j7s_publisher',
|
||||
parameters=[{
|
||||
"message":"Hello"
|
||||
}]
|
||||
)
|
||||
parrot_node = launch_ros.actions.Node(
|
||||
package='j7s-simple',
|
||||
executable='j7s-parrot',
|
||||
package='j7s_simple',
|
||||
executable='j7s_parrot',
|
||||
name='j7s_parrot_1',
|
||||
parameters=[{
|
||||
"name":"Polly"
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?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>j7s-simple</name>
|
||||
<name>j7s_simple</name>
|
||||
<version>0.0.0</version>
|
||||
<description>A set of simple nodes for testing things which package ros2.</description>
|
||||
<maintainer email="jpace121@gmail.com">James Pace</maintainer>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#include <fmt/core.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <j7s-simple/j7s-parrot.hpp>
|
||||
#include <j7s_simple/j7s_parrot.hpp>
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
J7sParrot::J7sParrot() : Node("j7s_parrot"), m_name{declare_parameter<std::string>("name")}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
#include <fmt/core.h>
|
||||
|
||||
#include <chrono>
|
||||
#include <j7s-simple/j7s-publisher.hpp>
|
||||
#include <j7s_simple/j7s_publisher.hpp>
|
||||
using namespace std::chrono_literals;
|
||||
|
||||
J7sPublisher::J7sPublisher() :
|
||||
Loading…
Reference in New Issue