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

Add abb_common package #26

Open
wants to merge 32 commits into
base: rolling
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
283bdcd
Added rws client
gbartyzel Apr 5, 2022
4a83dc4
Merge abb_rws_client to abb_hardware_interface
gbartyzel Apr 5, 2022
7afc426
Add debug logs
gbartyzel Apr 5, 2022
8c7985c
Clean up header guards
gbartyzel Apr 5, 2022
dc60fee
Remove .cache
gbartyzel Apr 5, 2022
a88ce61
Add rws client launch and minor clean up
gbartyzel Apr 6, 2022
1fe13f6
Remove .cache
gbartyzel Apr 6, 2022
beb3895
Add gitignore
gbartyzel Apr 6, 2022
5d1e412
Add license mentions
gbartyzel Apr 6, 2022
70f7b19
Apply suggestions from code review
gbartyzel May 10, 2022
53027e9
Move rws client to own package
gbartyzel May 23, 2022
d71cf39
Merge branch 'rolling' into gbartyzel/rws_client
gbartyzel May 31, 2022
40163e9
Apply formatting
gbartyzel May 31, 2022
381e394
Rename methods
gbartyzel May 31, 2022
c503da4
Apply fixes
gbartyzel May 31, 2022
c464ad9
Resolving review comments
gbartyzel Jun 14, 2022
d543aea
Changed cmake and launch file
gbartyzel Jun 15, 2022
6246534
Fixed connection problems
gbartyzel Jun 15, 2022
62d7e6a
Add docstrings and perform minor clean up
gbartyzel Jun 20, 2022
a3181e5
Fix bug with topic name in service provider class
gbartyzel Jun 20, 2022
0706407
Add simple quick start documentation
gbartyzel Jun 20, 2022
d9c1d61
Add comments to rws_service_provider source files
gbartyzel Jun 20, 2022
6d01a3e
Modify RWS docs
gbartyzel Jun 20, 2022
4514127
Create abb_common package
gbartyzel Jun 20, 2022
95f7466
Merge branch 'rolling' into gbartyzel/utils_package
gbartyzel Jun 25, 2022
557ac2b
Updated gitignore
gbartyzel Jun 25, 2022
44b1759
Updated package.xml files
gbartyzel Jun 30, 2022
4640a0e
Removed .clangd
gbartyzel Jun 30, 2022
48cb052
Merge branch 'rolling' of github.com:gbartyzel/abb_ros2 into gbartyze…
gbartyzel Jun 30, 2022
747fab0
Applied formatter
gbartyzel Jun 30, 2022
0b098c4
Merge branch 'rolling' of github.com:gbartyzel/abb_ros2 into gbartyze…
gbartyzel Aug 15, 2022
e68bab7
Merge branch 'gbartyzel/utils_package' of github.com:gbartyzel/abb_ro…
gbartyzel Aug 15, 2022
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.cache/
.clangd/
compile_commands.json
*.pyc
196 changes: 196 additions & 0 deletions abb_bringup/launch/abb_moveit_no_rviz.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import OpaqueFunction
from launch.substitutions import (
Command,
FindExecutable,
LaunchConfiguration,
PathJoinSubstitution,
)
from launch_ros.actions import Node
from launch_ros.substitutions import FindPackageShare
import os
import yaml


def load_yaml(package_name, file_path):
package_path = get_package_share_directory(package_name)
absolute_file_path = os.path.join(package_path, file_path)

try:
with open(absolute_file_path, "r") as file:
return yaml.safe_load(file)
except EnvironmentError: # parent of IOError, OSError *and* WindowsError where available
return None


def launch_setup(context, *args, **kwargs):
# Command-line arguments
robot_xacro_file = LaunchConfiguration("robot_xacro_file")
support_package = LaunchConfiguration("support_package")
moveit_config_package = LaunchConfiguration("moveit_config_package")
moveit_config_file = LaunchConfiguration("moveit_config_file")

# Planning context
robot_description_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare(support_package), "urdf", robot_xacro_file]
),
]
)
robot_description = {"robot_description": robot_description_content}

robot_description_semantic_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare(moveit_config_package), "config", moveit_config_file]
),
]
)
robot_description_semantic = {
"robot_description_semantic": robot_description_semantic_content.perform(
context
)
}

kinematics_yaml = load_yaml(
"abb_irb1200_5_90_moveit_config", "config/kinematics.yaml"
)

# Planning Functionality
ompl_planning_pipeline_config = {
"move_group": {
"planning_plugin": "ompl_interface/OMPLPlanner",
"request_adapters": """default_planner_request_adapters/AddTimeOptimalParameterization default_planner_request_adapters/ResolveConstraintFrames default_planner_request_adapters/FixWorkspaceBounds default_planner_request_adapters/FixStartStateBounds default_planner_request_adapters/FixStartStateCollision default_planner_request_adapters/FixStartStatePathConstraints""",
"start_state_max_bounds_error": 0.1,
}
}
ompl_planning_yaml = load_yaml(
"abb_irb1200_5_90_moveit_config", "config/ompl_planning.yaml"
)
ompl_planning_pipeline_config["move_group"].update(ompl_planning_yaml)

# Trajectory Execution Functionality
moveit_simple_controllers_yaml = load_yaml(
"abb_irb1200_5_90_moveit_config", "config/moveit_controllers.yaml"
)
moveit_controllers = {
"moveit_simple_controller_manager": moveit_simple_controllers_yaml,
"moveit_controller_manager": "moveit_simple_controller_manager/MoveItSimpleControllerManager",
}

trajectory_execution = {
# MoveIt does not handle controller switching automatically
"moveit_manage_controllers": False,
"trajectory_execution.allowed_execution_duration_scaling": 1.2,
"trajectory_execution.allowed_goal_duration_margin": 0.5,
"trajectory_execution.allowed_start_tolerance": 0.01,
}

planning_scene_monitor_parameters = {
"publish_planning_scene": True,
"publish_geometry_updates": True,
"publish_state_updates": True,
"publish_transforms_updates": True,
}

# Start the actual move_group node/action server
move_group_node = Node(
package="moveit_ros_move_group",
executable="move_group",
output="screen",
parameters=[
robot_description,
robot_description_semantic,
kinematics_yaml,
ompl_planning_pipeline_config,
trajectory_execution,
moveit_controllers,
planning_scene_monitor_parameters,
],
)

# RViz
rviz_base = os.path.join(
get_package_share_directory("abb_irb1200_5_90_moveit_config"), "rviz"
)
rviz_config = os.path.join(rviz_base, "moveit.rviz")
rviz_node = Node(
package="rviz2",
executable="rviz2",
name="rviz2",
output="log",
arguments=["-d", rviz_config],
parameters=[
robot_description,
robot_description_semantic,
ompl_planning_pipeline_config,
kinematics_yaml,
],
)

# Static TF
static_tf_node = Node(
package="tf2_ros",
executable="static_transform_publisher",
name="static_transform_publisher",
output="log",
arguments=["0.0", "0.0", "0.0", "0.0", "0.0", "0.0", "world", "base_link"],
)

# Publish TF
robot_state_pub_node = Node(
package="robot_state_publisher",
executable="robot_state_publisher",
name="robot_state_publisher",
output="both",
parameters=[robot_description],
)

nodes_to_start = [move_group_node, rviz_node, static_tf_node, robot_state_pub_node]
return nodes_to_start


def generate_launch_description():

declared_arguments = []

# TODO(andyz): add other options
declared_arguments.append(
DeclareLaunchArgument(
"robot_xacro_file",
description="Xacro describing the robot.",
choices=["irb1200_5_90.xacro"],
)
)
declared_arguments.append(
DeclareLaunchArgument(
"support_package",
description="Name of the support package",
choices=["abb_irb1200_support"],
)
)
declared_arguments.append(
DeclareLaunchArgument(
"moveit_config_package",
description="Name of the support package",
choices=["abb_irb1200_5_90_moveit_config"],
)
)
declared_arguments.append(
DeclareLaunchArgument(
"moveit_config_file",
description="Name of the SRDF file",
choices=["abb_irb1200_5_90.srdf.xacro"],
)
)

return LaunchDescription(
declared_arguments + [OpaqueFunction(function=launch_setup)]
)
78 changes: 78 additions & 0 deletions abb_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
cmake_minimum_required(VERSION 3.8)
project(abb_common)

# 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(-W -Wall -Wextra
-Wwrite-strings -Wunreachable-code -Wpointer-arith
-Winit-self -Wredundant-decls
-Wno-unused-parameter -Wno-unused-function)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
abb_egm_rws_managers
abb_egm_msgs
abb_rapid_msgs
abb_rapid_sm_addin_msgs
abb_robot_msgs
rclcpp
)

# find dependencies
find_package(ament_cmake REQUIRED)

foreach(Dependency IN ITEMS ${THIS_PACKAGE_INCLUDE_DEPENDS})
find_package(${Dependency} REQUIRED)
endforeach()

add_library(${PROJECT_NAME}
SHARED
src/mapping.cpp
src/utilities.cpp
)
ament_target_dependencies(${PROJECT_NAME} ${THIS_PACKAGE_INCLUDE_DEPENDS})
target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)

ament_export_include_directories(include)
ament_export_libraries(${PROJECT_NAME})
ament_export_targets(${PROJECT_NAME})
ament_export_dependencies(${THIS_PACKAGE_INCLUDE_DEPENDS})

install(
TARGETS ${PROJECT_NAME}
EXPORT ${PROJECT_NAME}
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)

install(
DIRECTORY include/
DESTINATION include
)

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()
Loading