Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ros2 migration behavior/arm #695

Merged
merged 18 commits into from
Mar 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
359 changes: 126 additions & 233 deletions astrobee/launch/robot/LLP.launch.py

Large diffs are not rendered by default.

87 changes: 73 additions & 14 deletions astrobee/launch/robot/MLP.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def generate_launch_description():
namespace='',
package='rclcpp_components',
executable='component_container',
condition=IfCondition(LaunchConfiguration("gtloc")),
composable_node_descriptions=[
# ComposableNode(
# package='localization_manager',
Expand All @@ -61,9 +62,8 @@ def generate_launch_description():
# extra_arguments=[{'use_intra_process_comms': True}]),
ComposableNode(
package='ground_truth_localizer',
plugin='ground_truth_localizer::GroundTruthLocalizerNodelet',
plugin='ground_truth_localizer::GroundTruthLocalizerComponent',
name='ground_truth_localizer',
# condition=IfCondition(LaunchConfiguration("gtloc"))
),
# ComposableNode(
# package='image_sampler',
Expand All @@ -75,10 +75,32 @@ def generate_launch_description():
]
),
ComposableNodeContainer(
name='mlp_localization',
namespace='',
package='rclcpp_components',
executable='component_container',
condition=UnlessCondition(LaunchConfiguration("gtloc")),
composable_node_descriptions=[
# ComposableNode(
# package='localization_manager',
# plugin='localization_manager::LocalizationManagerNodelet',
# name='localization_manager',
# extra_arguments=[{'use_intra_process_comms': True}]),
# ComposableNode(
# package='image_sampler',
# plugin='image_sampler::ImageSampler',
# name='image_sampler',
# remappings=[('/image', '/burgerimage')],
# parameters=[{'history': 'keep_last'}],
# extra_arguments=[{'use_intra_process_comms': True}])
]
),
ComposableNodeContainer(
name='mlp_graph_localization',
namespace='',
package='rclcpp_components',
executable='component_container',
condition=UnlessCondition(LaunchConfiguration("gtloc")),
composable_node_descriptions=[
# ComposableNode(
# package='graph_loc',
Expand All @@ -92,6 +114,7 @@ def generate_launch_description():
namespace='',
package='rclcpp_components',
executable='component_container',
condition=IfCondition(LaunchConfiguration("drivers")),
composable_node_descriptions=[
# ComposableNode(
# package='depth_odometry_nodelet',
Expand Down Expand Up @@ -149,7 +172,27 @@ def generate_launch_description():
name='mlp_depth_cam',
namespace='',
package='rclcpp_components',
condition=UnlessCondition(LaunchConfiguration("drivers")),
executable='component_container',
composable_node_descriptions=[
# ComposableNode(
# package='handrail_detect',
# plugin='handrail_detect::HandrailDetect',
# name='handrail_detect',
# extra_arguments=[{'use_intra_process_comms': True}]),
# ComposableNode(
# package='planner_qp',
# plugin='planner_qp::Planner',
# name='planner_qp',
# extra_arguments=[{'use_intra_process_comms': True}]),
]
),
ComposableNodeContainer(
name='mlp_depth_cam',
namespace='',
package='rclcpp_components',
executable='component_container',
condition=IfCondition(LaunchConfiguration("drivers")),
composable_node_descriptions=[
# ComposableNode(
# package='handrail_detect',
Expand Down Expand Up @@ -222,6 +265,7 @@ def generate_launch_description():
namespace='',
package='rclcpp_components',
executable='component_container',
condition=IfCondition(LaunchConfiguration("drivers")),
composable_node_descriptions=[
# ComposableNode(
# package='sys_monitor',
Expand All @@ -241,6 +285,20 @@ def generate_launch_description():
]
),
ComposableNodeContainer(
name='mlp_monitors',
namespace='',
package='rclcpp_components',
executable='component_container',
condition=UnlessCondition(LaunchConfiguration("drivers")),
composable_node_descriptions=[
# ComposableNode(
# package='sys_monitor',
# plugin='sys_monitor::SysMonitor',
# name='sys_monitor',
# extra_arguments=[{'use_intra_process_comms': True}]),
]
),
ComposableNodeContainer(
name='mlp_communications',
namespace='',
package='rclcpp_components',
Expand Down Expand Up @@ -271,6 +329,7 @@ def generate_launch_description():
namespace='',
package='rclcpp_components',
executable='component_container',
condition=IfCondition(LaunchConfiguration("drivers")),
composable_node_descriptions=[
# ComposableNode(
# package='perching_arm',
Expand All @@ -283,7 +342,7 @@ def generate_launch_description():
name='mlp_mobility',
namespace='',
package='rclcpp_components',
executable='component_container',
executable='component_container_mt',
composable_node_descriptions=[
ComposableNode(
package='choreographer',
Expand All @@ -307,13 +366,12 @@ def generate_launch_description():
name='mlp_arm',
namespace='',
package='rclcpp_components',
executable='component_container',
executable='component_container_mt',
composable_node_descriptions=[
# ComposableNode(
# package='arm',
# plugin='arm::ArmNodelet',
# name='arm',
# extra_arguments=[{'use_intra_process_comms': True}]),
ComposableNode(
package='arm',
plugin='arm::ArmComponent',
name='arm'),
]
),
ComposableNodeContainer(
Expand Down Expand Up @@ -347,6 +405,7 @@ def generate_launch_description():
namespace='',
package='rclcpp_components',
executable='component_container',
condition=IfCondition(LaunchConfiguration("drivers")),
composable_node_descriptions=[
# ComposableNode(
# package='vive',
Expand All @@ -361,11 +420,11 @@ def generate_launch_description():
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
# ComposableNode(
# package='states',
# plugin='states::StatesNodelet',
# name='states',
# extra_arguments=[{'use_intra_process_comms': True}]),
ComposableNode(
package='states',
plugin='states::StatesComponent',
name='states',
extra_arguments=[{'use_intra_process_comms': True}]),
]
),
])
Expand Down
86 changes: 39 additions & 47 deletions behaviors/arm/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,78 +15,68 @@
# License for the specific language governing permissions and limitations
# under the License.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)
project(arm)

## Compile as C++14, supported in ROS Kinetic and newer
add_compile_options(-std=c++14)
add_definitions(-DROS1)

## Find catkin macros and libraries
find_package(catkin2 REQUIRED COMPONENTS
roscpp
std_msgs
nodelet
ff_msgs
ff_hw_msgs
ff_util
)
# Default to C++14
if(NOT CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 14)
endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -O3 -fPIC" )

catkin_package(
LIBRARIES
arm
CATKIN_DEPENDS
roscpp
nodelet
pluginlib
actionlib
sensor_msgs
ff_msgs
ff_hw_msgs
ff_util
set(dependencies
rclcpp
rclcpp_components
ff_hw_msgs
ff_msgs
sensor_msgs
ff_util
ff_common
)

## Find ament and libraries
find_package(ament_cmake REQUIRED)

foreach(dep ${dependencies})
find_package(${dep} REQUIRED)
endforeach()



###########
## Build ##
###########

# Specify additional locations of header files
include_directories(
include
${catkin_INCLUDE_DIRS}
)

# Declare C++ libraries
add_library(arm
src/arm_nodelet.cc
add_library(arm SHARED
src/arm_component.cc
)
add_dependencies(arm ${catkin_EXPORTED_TARGETS})
target_link_libraries(arm ${catkin_LIBRARIES})
target_compile_definitions(arm PRIVATE "COMPOSITION_BUILDING_DLL")
ament_target_dependencies(arm ${dependencies})
rclcpp_components_register_nodes(arm "arm::ArmComponent")

## Declare a C++ executable: arm_tool
add_executable(arm_tool tools/arm_tool.cc)
add_dependencies(arm_tool ${catkin_EXPORTED_TARGETS})
ament_target_dependencies(arm_tool ${dependencies})
target_link_libraries(arm_tool
arm gflags ${catkin_LIBRARIES})
arm gflags)

#############
## Install ##
#############

# Mark libraries for installation
install(TARGETS ${PROJECT_NAME}
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)

# Mark nodelet_plugin for installation
install(FILES nodelet_plugins.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
# Mark libraries and tools for installation
install(TARGETS ${PROJECT_NAME} arm_tool
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION lib/${PROJECT_NAME}
)

# Install C++ executables
install(TARGETS arm_tool DESTINATION bin)
install(CODE "execute_process(
COMMAND ln -s ../../bin/arm_tool share/${PROJECT_NAME}
WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}
Expand All @@ -95,6 +85,8 @@ install(CODE "execute_process(
)")

# Mark launch files for installation
install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
install(DIRECTORY launch
DESTINATION share/${PROJECT_NAME}
PATTERN ".svn" EXCLUDE)

ament_package()
Empty file removed behaviors/arm/COLCON_IGNORE
Empty file.
5 changes: 0 additions & 5 deletions behaviors/arm/nodelet_plugins.xml

This file was deleted.

26 changes: 12 additions & 14 deletions behaviors/arm/package.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package>
<package format="3">
<name>arm</name>
<version>0.0.0</version>
<description>
Expand All @@ -14,23 +14,21 @@
<maintainer email="[email protected]">
Astrobee Flight Software
</maintainer>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>roscpp</build_depend>
<build_depend>nodelet</build_depend>
<build_depend>pluginlib</build_depend>
<buildtool_depend>ament_cmake</buildtool_depend>
<build_depend>rclcpp</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>ff_msgs</build_depend>
<build_depend>ff_hw_msgs</build_depend>
<build_depend>ff_util</build_depend>
<run_depend>roscpp</run_depend>
<run_depend>nodelet</run_depend>
<run_depend>pluginlib</run_depend>
<run_depend>actionlib</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>ff_msgs</run_depend>
<run_depend>ff_hw_msgs</run_depend>
<run_depend>ff_util</run_depend>

<exec_depend>rclcpp</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>ff_msgs</exec_depend>
<exec_depend>ff_hw_msgs</exec_depend>
<exec_depend>ff_util</exec_depend>
<exec_depend>rclcpp_components</exec_depend>

<export>
<nodelet plugin="${prefix}/nodelet_plugins.xml" />
<build_type>ament_cmake</build_type>
</export>
</package>
Loading