Skip to content

Commit

Permalink
Fix CI permission errors
Browse files Browse the repository at this point in the history
  • Loading branch information
AndyZe committed May 2, 2022
1 parent cd39fc2 commit ac25c3f
Show file tree
Hide file tree
Showing 3 changed files with 120 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .docker/ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ RUN \
ccache && \
#
# Fetch all dependencies from moveit2.repos
# Fetch required upstream sources for building
# As of 5/2/2022, permissions need to be set explicitly.
# See https://github.com/actions/checkout/issues/760.
git config --global --add safe.directory /home/runner/work/moveit2/moveit2/.work/upstream_ws/src/geometric_shapes && \
git config --global --add safe.directory /home/runner/work/moveit2/moveit2/.work/upstream_ws/src/moveit_resources && \
git config --global --add safe.directory /home/runner/work/moveit2/moveit2/.work/upstream_ws/src/srdfdom && \
#
vcs import src < src/moveit2/moveit2.repos && \
if [ -r src/moveit2/moveit2_${ROS_DISTRO}.repos ] ; then vcs import src < src/moveit2/moveit2_${ROS_DISTRO}.repos ; fi && \
#
Expand Down
7 changes: 7 additions & 0 deletions .docker/source/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ COPY . src/moveit2
RUN --mount=type=cache,target=/root/.ccache/ \
# Enable ccache
PATH=/usr/lib/ccache:$PATH && \
#
# Fetch required upstream sources for building
# As of 5/2/2022, permissions need to be set explicitly.
# See https://github.com/actions/checkout/issues/760.
git config --global --add safe.directory /home/runner/work/moveit2/moveit2/.work/upstream_ws/src/geometric_shapes && \
git config --global --add safe.directory /home/runner/work/moveit2/moveit2/.work/upstream_ws/src/moveit_resources && \
git config --global --add safe.directory /home/runner/work/moveit2/moveit2/.work/upstream_ws/src/srdfdom && \
#
vcs import src < src/moveit2/moveit2.repos && \
if [ -r src/moveit2/moveit2_${ROS_DISTRO}.repos ] ; then vcs import src < src/moveit2/moveit2_${ROS_DISTRO}.repos ; fi && \
#
Expand Down
108 changes: 106 additions & 2 deletions moveit_configs_utils/moveit_configs_utils/launches.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.actions import (
DeclareLaunchArgument,
IncludeLaunchDescription,
)
from launch.conditions import IfCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration

from launch_ros.actions import Node
Expand Down Expand Up @@ -60,7 +64,7 @@ def generate_moveit_rviz_launch(moveit_config):
package="rviz2",
executable="rviz2",
output="log",
respawn=True,
respawn=False,
arguments=["-d", LaunchConfiguration("rviz_config")],
parameters=rviz_parameters,
)
Expand Down Expand Up @@ -231,3 +235,103 @@ def generate_move_group_launch(moveit_config):
additional_env={"DISPLAY": ":0"},
)
return ld


def generate_demo_launch(moveit_config):
"""
Launches a self contained demo
Includes
* static_virtual_joint_tfs
* robot_state_publisher
* move_group
* moveit_rviz
* warehouse_db (optional)
* ros2_control_node + controller spawners
"""
ld = LaunchDescription()
ld.add_action(
DeclareBooleanLaunchArg(
"db",
default_value=False,
description="By default, we do not start a database (it can be large)",
)
)
ld.add_action(
DeclareBooleanLaunchArg(
"debug",
default_value=False,
description="By default, we are not in debug mode",
)
)
ld.add_action(DeclareBooleanLaunchArg("use_rviz", default_value=True))

# If there are virtual joints, broadcast static tf by including virtual_joints launch
virtual_joints_launch = (
moveit_config.package_path / "launch/static_virtual_joint_tfs.launch.py"
)
if virtual_joints_launch.exists():
ld.add_action(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(str(virtual_joints_launch)),
)
)

# Given the published joint states, publish tf for the robot links
ld.add_action(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
str(moveit_config.package_path / "launch/rsp.launch.py")
),
)
)

ld.add_action(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
str(moveit_config.package_path / "launch/move_group.launch.py")
),
)
)

# Run Rviz and load the default config to see the state of the move_group node
ld.add_action(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
str(moveit_config.package_path / "launch/moveit_rviz.launch.py")
),
condition=IfCondition(LaunchConfiguration("use_rviz")),
)
)

# If database loading was enabled, start mongodb as well
ld.add_action(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
str(moveit_config.package_path / "launch/warehouse_db.launch.py")
),
condition=IfCondition(LaunchConfiguration("db")),
)
)

# Fake joint driver
ld.add_action(
Node(
package="controller_manager",
executable="ros2_control_node",
parameters=[
moveit_config.robot_description,
str(moveit_config.package_path / "config/ros2_controllers.yaml"),
],
)
)

ld.add_action(
IncludeLaunchDescription(
PythonLaunchDescriptionSource(
str(moveit_config.package_path / "launch/spawn_controllers.launch.py")
),
)
)

return ld

0 comments on commit ac25c3f

Please sign in to comment.