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

Support ROS 2 #4

Merged
merged 14 commits into from
Oct 11, 2023
13 changes: 2 additions & 11 deletions .github/workflows/industrial_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,14 @@ on:
pull_request:
paths-ignore:
- '**.md'
schedule:
- cron: "0 2 * * 0" # Weekly on Sundays at 02:00
workflow_dispatch:

jobs:
industrial_ci:
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
env:
- { ROS_DISTRO: melodic, ROS_REPO: main }
- { ROS_DISTRO: noetic, ROS_REPO: main }
experimental: [false]
include:
- env: { ROS_DISTRO: melodic, ROS_REPO: testing }
experimental: true
- env: { ROS_DISTRO: noetic, ROS_REPO: testing }
experimental: true
- { ROS_DISTRO: humble, ROS_REPO: ros, BEFORE_RUN_TARGET_TEST_EMBED: "ici_with_unset_variables source /root/target_ws/install/setup.bash" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
44 changes: 19 additions & 25 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,27 @@
cmake_minimum_required(VERSION 2.8.3)
cmake_minimum_required(VERSION 3.5)
project(sciurus17_description)

# add_definitions(-std=c++11)
find_package(ament_cmake REQUIRED)

find_package(catkin REQUIRED COMPONENTS
rospy
std_msgs
install(DIRECTORY
launch
meshes
urdf
DESTINATION share/${PROJECT_NAME}/
)

# catkin_python_setup()
ament_python_install_package(${PROJECT_NAME})
install(PROGRAMS
${PROJECT_NAME}/robot_description_loader.py
DESTINATION lib/${PROJECT_NAME})

###################################
## catkin specific configuration ##
###################################
catkin_package(
)
if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
set(ament_cmake_copyright_FOUND TRUE) # Skip copyright checks
ament_lint_auto_find_test_dependencies()

###########
## Build ##
###########
include_directories(
${catkin_INCLUDE_DIRS}
)
find_package(ament_cmake_pytest REQUIRED)
# ament_add_pytest_test(test_robot_description_loader test/test_robot_description_loader.py)
endif()

#############
## Install ##
#############
foreach(dir config launch meshes urdf)
install(DIRECTORY ${dir}/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/${dir}
)
endforeach(dir)
ament_package()
13 changes: 0 additions & 13 deletions launch/display.launch

This file was deleted.

34 changes: 34 additions & 0 deletions launch/display.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2023 RT Corporation

from ament_index_python.packages import get_package_share_directory
from sciurus17_description.robot_description_loader import RobotDescriptionLoader
from launch import LaunchDescription
from launch_ros.actions import Node


def generate_launch_description():
description_loader = RobotDescriptionLoader()

rsp = Node(package='robot_state_publisher',
executable='robot_state_publisher',
output='both',
parameters=[{'robot_description': description_loader.load()}])
jsp = Node(
package='joint_state_publisher_gui',
executable='joint_state_publisher_gui',
output='screen')

rviz_config_file = get_package_share_directory(
'sciurus17_description') + '/launch/display.rviz'
rviz = Node(package='rviz2',
executable='rviz2',
name='rviz2',
output='log',
arguments=['-d', rviz_config_file])

ld = LaunchDescription()
ld.add_action(rsp)
ld.add_action(jsp)
ld.add_action(rviz)

return ld
Loading