From 2f31c2774d0c501d65ec21589426cdc40a57ef39 Mon Sep 17 00:00:00 2001 From: AustinDeric Date: Sat, 26 Sep 2020 23:49:08 -0500 Subject: [PATCH 1/7] convert to ROS2 Foxy --- spot_description/CMakeLists.txt | 15 ++-- spot_description/package.xml | 10 ++- spot_driver/CMakeLists.txt | 23 ------ spot_driver/package.xml | 9 +-- spot_driver/resource/spot_driver | 0 spot_driver/setup.py | 36 ++++++++++ .../{scripts => spot_driver}/__init__.py | 0 .../{scripts => spot_driver}/ros_helpers.py | 0 .../{scripts => spot_driver}/spot_ros.py | 0 .../{scripts => spot_driver}/spot_wrapper.py | 0 spot_msgs/CMakeLists.txt | 70 ++++++++----------- spot_msgs/msg/BatteryState.msg | 4 +- spot_msgs/msg/BehaviorFault.msg | 2 +- spot_msgs/msg/EStopState.msg | 2 +- spot_msgs/msg/Metrics.msg | 6 +- spot_msgs/msg/PowerState.msg | 4 +- spot_msgs/msg/SystemFault.msg | 4 +- spot_msgs/package.xml | 28 ++++---- spot_viz/CMakeLists.txt | 14 ++-- spot_viz/package.xml | 10 ++- 20 files changed, 121 insertions(+), 116 deletions(-) delete mode 100644 spot_driver/CMakeLists.txt create mode 100644 spot_driver/resource/spot_driver create mode 100644 spot_driver/setup.py rename spot_driver/{scripts => spot_driver}/__init__.py (100%) rename spot_driver/{scripts => spot_driver}/ros_helpers.py (100%) rename spot_driver/{scripts => spot_driver}/spot_ros.py (100%) rename spot_driver/{scripts => spot_driver}/spot_wrapper.py (100%) diff --git a/spot_description/CMakeLists.txt b/spot_description/CMakeLists.txt index a13ef4bd..1ee8901f 100644 --- a/spot_description/CMakeLists.txt +++ b/spot_description/CMakeLists.txt @@ -1,14 +1,9 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.5) project(spot_description) -find_package(catkin REQUIRED COMPONENTS) +find_package(ament_cmake REQUIRED) -catkin_package() +install(DIRECTORY launch urdf meshes + DESTINATION share/${PROJECT_NAME}) -include_directories( - ${catkin_INCLUDE_DIRS} -) - -install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) -install(DIRECTORY urdf DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) -install(DIRECTORY meshes DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) +ament_package() diff --git a/spot_description/package.xml b/spot_description/package.xml index ad2ca919..56960ee7 100644 --- a/spot_description/package.xml +++ b/spot_description/package.xml @@ -1,19 +1,23 @@ - + + spot_description - 0.0.0 + 2.0.0 The spot_description package Dave Niewinski BSD - catkin + ament_cmake robot_state_publisher urdf xacro + ament_cmake + diff --git a/spot_driver/CMakeLists.txt b/spot_driver/CMakeLists.txt deleted file mode 100644 index 9727c156..00000000 --- a/spot_driver/CMakeLists.txt +++ /dev/null @@ -1,23 +0,0 @@ -cmake_minimum_required(VERSION 2.8.3) -project(spot_driver) - -find_package(catkin REQUIRED COMPONENTS) - -catkin_package() - -include_directories( - ${catkin_INCLUDE_DIRS} -) - -catkin_install_python( - PROGRAMS - scripts/ros_helpers.py - scripts/spot_ros.py - scripts/spot_wrapper.py - scripts/__init__.py - DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} -) - -install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) -install(DIRECTORY doc DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) -install(DIRECTORY config DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) diff --git a/spot_driver/package.xml b/spot_driver/package.xml index 366ad831..d5841df6 100644 --- a/spot_driver/package.xml +++ b/spot_driver/package.xml @@ -1,22 +1,23 @@ - + + spot_driver - 0.0.0 + 2.0.0 The spot_driver package Dave Niewinski BSD - catkin + rclpy spot_msgs std_srvs tf2_msgs geometry_msgs sensor_msgs - rospy + ament_python diff --git a/spot_driver/resource/spot_driver b/spot_driver/resource/spot_driver new file mode 100644 index 00000000..e69de29b diff --git a/spot_driver/setup.py b/spot_driver/setup.py new file mode 100644 index 00000000..6ff43d9e --- /dev/null +++ b/spot_driver/setup.py @@ -0,0 +1,36 @@ + +from setuptools import setup + +package_name = 'spot_driver' + +setup( + name=package_name, + version='2.0.0', + packages=[package_name], + data_files=[ + ('share/ament_index/resource_index/packages', + ['resource/' + package_name]), + ('share/' + package_name, ['package.xml']), + ], + install_requires=['setuptools'], + zip_safe=True, + author='Dave Niewinski', + author_email='dniewinski@clearpathrobotics.com', + maintainer='Dave Niewinski', + maintainer_email='dniewinski@clearpathrobotics.com', + keywords=['ROS'], + classifiers=[ + 'Intended Audience :: Developers', + 'License :: OSI Approved :: BSD', + 'Programming Language :: Python', + 'Topic :: Software Development', + ], + description='The spot_driver package', + license='BSD', + tests_require=['pytest'], + entry_points={ + 'console_scripts': [ + 'driver = spot_driver.spot_ros.py:main', + ], + }, +) \ No newline at end of file diff --git a/spot_driver/scripts/__init__.py b/spot_driver/spot_driver/__init__.py similarity index 100% rename from spot_driver/scripts/__init__.py rename to spot_driver/spot_driver/__init__.py diff --git a/spot_driver/scripts/ros_helpers.py b/spot_driver/spot_driver/ros_helpers.py similarity index 100% rename from spot_driver/scripts/ros_helpers.py rename to spot_driver/spot_driver/ros_helpers.py diff --git a/spot_driver/scripts/spot_ros.py b/spot_driver/spot_driver/spot_ros.py similarity index 100% rename from spot_driver/scripts/spot_ros.py rename to spot_driver/spot_driver/spot_ros.py diff --git a/spot_driver/scripts/spot_wrapper.py b/spot_driver/spot_driver/spot_wrapper.py similarity index 100% rename from spot_driver/scripts/spot_wrapper.py rename to spot_driver/spot_driver/spot_wrapper.py diff --git a/spot_msgs/CMakeLists.txt b/spot_msgs/CMakeLists.txt index 21edb3c8..522daf6b 100644 --- a/spot_msgs/CMakeLists.txt +++ b/spot_msgs/CMakeLists.txt @@ -1,46 +1,36 @@ -cmake_minimum_required(VERSION 3.0.2) +cmake_minimum_required(VERSION 3.5) project(spot_msgs) -find_package(catkin REQUIRED COMPONENTS - geometry_msgs - nav_msgs - sensor_msgs - std_msgs - message_generation -) +find_package(ament_cmake REQUIRED) +find_package(builtin_interfaces REQUIRED) +find_package(nav_msgs REQUIRED) +find_package(geometry_msgs REQUIRED) +find_package(rosidl_default_generators REQUIRED) +find_package(std_msgs REQUIRED) +find_package(sensor_msgs REQUIRED) -add_message_files( - FILES - BatteryStateArray.msg - BehaviorFault.msg - EStopStateArray.msg - FootStateArray.msg - LeaseArray.msg - LeaseOwner.msg - Metrics.msg - SystemFault.msg - WiFiState.msg - BatteryState.msg - BehaviorFaultState.msg - EStopState.msg - Feedback.msg - FootState.msg - Lease.msg - LeaseResource.msg - PowerState.msg - SystemFaultState.msg +rosidl_generate_interfaces(${PROJECT_NAME} + "msg/BatteryStateArray.msg" + "msg/BehaviorFault.msg" + "msg/EStopStateArray.msg" + "msg/FootStateArray.msg" + "msg/LeaseArray.msg" + "msg/LeaseOwner.msg" + "msg/Metrics.msg" + "msg/SystemFault.msg" + "msg/WiFiState.msg" + "msg/BatteryState.msg" + "msg/BehaviorFaultState.msg" + "msg/EStopState.msg" + "msg/Feedback.msg" + "msg/FootState.msg" + "msg/Lease.msg" + "msg/LeaseResource.msg" + "msg/PowerState.msg" + "msg/SystemFaultState.msg" + DEPENDENCIES builtin_interfaces geometry_msgs std_msgs nav_msgs sensor_msgs ) -generate_messages( - DEPENDENCIES - std_msgs - geometry_msgs -) +ament_export_dependencies(rosidl_default_runtime) -catkin_package( - CATKIN_DEPENDS message_runtime -) - -include_directories( - ${catkin_INCLUDE_DIRS} -) +ament_package() diff --git a/spot_msgs/msg/BatteryState.msg b/spot_msgs/msg/BatteryState.msg index 9437500b..3da6a552 100644 --- a/spot_msgs/msg/BatteryState.msg +++ b/spot_msgs/msg/BatteryState.msg @@ -5,10 +5,10 @@ uint8 STATUS_CHARGING = 2 uint8 STATUS_DISCHARGING = 3 uint8 STATUS_BOOTING = 4 -Header header +std_msgs/Header header string identifier float64 charge_percentage -duration estimated_runtime +builtin_interfaces/Duration estimated_runtime float64 current float64 voltage float64[] temperatures diff --git a/spot_msgs/msg/BehaviorFault.msg b/spot_msgs/msg/BehaviorFault.msg index 0c209af1..6aa247bc 100644 --- a/spot_msgs/msg/BehaviorFault.msg +++ b/spot_msgs/msg/BehaviorFault.msg @@ -8,7 +8,7 @@ uint8 STATUS_UNKNOWN = 0 uint8 STATUS_CLEARABLE = 1 uint8 STATUS_UNCLEARABLE = 2 -Header header +std_msgs/Header header uint32 behavior_fault_id uint8 cause uint8 status diff --git a/spot_msgs/msg/EStopState.msg b/spot_msgs/msg/EStopState.msg index 3e527d0b..3de884b8 100644 --- a/spot_msgs/msg/EStopState.msg +++ b/spot_msgs/msg/EStopState.msg @@ -8,7 +8,7 @@ uint8 STATE_UNKNOWN = 0 uint8 STATE_ESTOPPED = 1 uint8 STATE_NOT_ESTOPPED = 2 -Header header +std_msgs/Header header string name uint8 type uint8 state diff --git a/spot_msgs/msg/Metrics.msg b/spot_msgs/msg/Metrics.msg index b699a09f..436d7da7 100644 --- a/spot_msgs/msg/Metrics.msg +++ b/spot_msgs/msg/Metrics.msg @@ -1,5 +1,5 @@ -Header header +std_msgs/Header header float32 distance int32 gait_cycles -duration time_moving -duration electric_power +builtin_interfaces/Duration time_moving +builtin_interfaces/Duration electric_power diff --git a/spot_msgs/msg/PowerState.msg b/spot_msgs/msg/PowerState.msg index 2f7285df..10040dfc 100644 --- a/spot_msgs/msg/PowerState.msg +++ b/spot_msgs/msg/PowerState.msg @@ -11,8 +11,8 @@ uint8 STATE_UNKNOWN_SHORE_POWER = 0 uint8 STATE_ON_SHORE_POWER = 1 uint8 STATE_OFF_SHORE_POWER = 2 -Header header +std_msgs/Header header uint8 motor_power_state uint8 shore_power_state float64 locomotion_charge_percentage -duration locomotion_estimated_runtime +builtin_interfaces/Duration locomotion_estimated_runtime diff --git a/spot_msgs/msg/SystemFault.msg b/spot_msgs/msg/SystemFault.msg index 25411024..a40fa9f2 100644 --- a/spot_msgs/msg/SystemFault.msg +++ b/spot_msgs/msg/SystemFault.msg @@ -4,9 +4,9 @@ uint8 SEVERITY_INFO = 1 uint8 SEVERITY_WARN = 2 uint8 SEVERITY_CRITICAL = 3 -Header header +std_msgs/Header header string name -duration duration +builtin_interfaces/Duration duration int32 code uint64 uid string error_message diff --git a/spot_msgs/package.xml b/spot_msgs/package.xml index b210d733..008878e2 100644 --- a/spot_msgs/package.xml +++ b/spot_msgs/package.xml @@ -1,25 +1,27 @@ - + + spot_msgs - 0.0.0 + 2.0.0 The spot_msgs package Dave Niewinski BSD - catkin - geometry_msgs - nav_msgs - sensor_msgs - std_msgs - geometry_msgs - nav_msgs - sensor_msgs - std_msgs + ament_cmake - message_generation - message_runtime + rclcpp + std_msgs + builtin_interfaces + rosidl_default_generators + geometry_msgs + nav_msgs + sensor_msgs + + rosidl_interface_packages + ament_cmake diff --git a/spot_viz/CMakeLists.txt b/spot_viz/CMakeLists.txt index 717a21c4..fddc9562 100644 --- a/spot_viz/CMakeLists.txt +++ b/spot_viz/CMakeLists.txt @@ -1,13 +1,9 @@ -cmake_minimum_required(VERSION 2.8.3) +cmake_minimum_required(VERSION 3.5) project(spot_viz) -find_package(catkin REQUIRED COMPONENTS) +find_package(ament_cmake REQUIRED) -catkin_package() +install(DIRECTORY launch rviz + DESTINATION share/${PROJECT_NAME}) -include_directories( - ${catkin_INCLUDE_DIRS} -) - -install(DIRECTORY rviz DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) -install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) +ament_package() \ No newline at end of file diff --git a/spot_viz/package.xml b/spot_viz/package.xml index 1f077199..fa4785ed 100644 --- a/spot_viz/package.xml +++ b/spot_viz/package.xml @@ -1,19 +1,23 @@ - + + spot_viz - 0.0.0 + 2.0.0 The spot_viz package Dave Niewinski BSD - catkin + ament_cmake joint_state_publisher joint_state_publisher_gui rviz + ament_cmake + From 6c18f2e19bcb0d9a0fe68dec3718aba82bfe7611 Mon Sep 17 00:00:00 2001 From: AustinDeric Date: Sat, 26 Sep 2020 23:57:48 -0500 Subject: [PATCH 2/7] add CI --- .github/workflows/ros2-build.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/ros2-build.yml diff --git a/.github/workflows/ros2-build.yml b/.github/workflows/ros2-build.yml new file mode 100644 index 00000000..bf4e6b1c --- /dev/null +++ b/.github/workflows/ros2-build.yml @@ -0,0 +1,17 @@ +name: ROS2 Colcon Build + +on: [push] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: ros-tooling/setup-ros@0.0.25 + - uses: ros-tooling/action-ros-ci@0.0.18 + with: + package-name: ament_copyright + target-ros2-distro: foxy + From 75694546e0b770d8ba93cefb32a89363b10f3b45 Mon Sep 17 00:00:00 2001 From: AustinDeric Date: Sun, 27 Sep 2020 00:09:13 -0500 Subject: [PATCH 3/7] fix typo --- .github/workflows/ros2-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ros2-build.yml b/.github/workflows/ros2-build.yml index bf4e6b1c..0a88d813 100644 --- a/.github/workflows/ros2-build.yml +++ b/.github/workflows/ros2-build.yml @@ -12,6 +12,6 @@ jobs: - uses: ros-tooling/setup-ros@0.0.25 - uses: ros-tooling/action-ros-ci@0.0.18 with: - package-name: ament_copyright + package-name: spot_ros target-ros2-distro: foxy From dd00e477876c3b4378f88e2f72a177e2ec6555bf Mon Sep 17 00:00:00 2001 From: AustinDeric Date: Sun, 27 Sep 2020 00:21:43 -0500 Subject: [PATCH 4/7] add metapackage to facilitate ci --- spot_ros/CHANGELOG.rst | 0 spot_ros/CMakeLists.txt | 10 ++++++++++ spot_ros/package.xml | 24 ++++++++++++++++++++++++ 3 files changed, 34 insertions(+) create mode 100644 spot_ros/CHANGELOG.rst create mode 100644 spot_ros/CMakeLists.txt create mode 100644 spot_ros/package.xml diff --git a/spot_ros/CHANGELOG.rst b/spot_ros/CHANGELOG.rst new file mode 100644 index 00000000..e69de29b diff --git a/spot_ros/CMakeLists.txt b/spot_ros/CMakeLists.txt new file mode 100644 index 00000000..b42b2a9b --- /dev/null +++ b/spot_ros/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.5) +project(spot_ros) + +if(NOT CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 14) +endif() + +find_package(ament_cmake REQUIRED) + +ament_package() \ No newline at end of file diff --git a/spot_ros/package.xml b/spot_ros/package.xml new file mode 100644 index 00000000..79afe3d0 --- /dev/null +++ b/spot_ros/package.xml @@ -0,0 +1,24 @@ + + + + spot_ros + 2.0.0 + + Spot ROS Driver + + Austin Deric + Dave Niewinski + Apache-2.0 + + ament_cmake + + spot_description + spot_driver + spot_msgs + spot_viz + + + ament_cmake + + + \ No newline at end of file From efe61df6fe0efe9c40f21067feed96285721ffbf Mon Sep 17 00:00:00 2001 From: AustinDeric Date: Sun, 27 Sep 2020 01:02:22 -0500 Subject: [PATCH 5/7] convert spot_description launch files --- spot_description/launch/description.launch | 5 ----- spot_description/launch/description.py | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 5 deletions(-) delete mode 100644 spot_description/launch/description.launch create mode 100644 spot_description/launch/description.py diff --git a/spot_description/launch/description.launch b/spot_description/launch/description.launch deleted file mode 100644 index 2e588d67..00000000 --- a/spot_description/launch/description.launch +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/spot_description/launch/description.py b/spot_description/launch/description.py new file mode 100644 index 00000000..8dcd6c94 --- /dev/null +++ b/spot_description/launch/description.py @@ -0,0 +1,21 @@ +import os + +import launch +import launch_ros.actions +from launch_ros.substitutions import FindPackageShare + +import xacro + +def generate_launch_description(): + pkg_share = FindPackageShare('robot_state_publisher').find('robot_state_publisher') + urdf_dir = os.path.join(pkg_share, 'urdf') + xacro_file = os.path.join(urdf_dir, 'spot.urdf.xacro') + doc = xacro.process_file(xacro_file) + robot_desc = doc.toprettyxml(indent=' ') + params = {'robot_description': robot_desc} + rsp = launch_ros.actions.Node(package='robot_state_publisher', + executable='robot_state_publisher', + output='both', + parameters=[params]) + + return launch.LaunchDescription([rsp]) From 149ec8424ffab7452cbe781d026abcdc0f35f2a6 Mon Sep 17 00:00:00 2001 From: AustinDeric Date: Mon, 28 Sep 2020 00:28:23 -0500 Subject: [PATCH 6/7] convert spot_viz launch files. fix CMakelists install dirs --- spot_description/CMakeLists.txt | 4 ++++ .../{description.py => description.launch.py} | 3 ++- spot_driver/setup.py | 4 ++-- spot_viz/CMakeLists.txt | 4 ++-- spot_viz/launch/view_model.launch | 7 ------ spot_viz/launch/view_model.launch.py | 24 +++++++++++++++++++ spot_viz/launch/view_robot.launch | 3 --- spot_viz/launch/view_robot.launch.py | 18 ++++++++++++++ 8 files changed, 52 insertions(+), 15 deletions(-) rename spot_description/launch/{description.py => description.launch.py} (85%) delete mode 100644 spot_viz/launch/view_model.launch create mode 100644 spot_viz/launch/view_model.launch.py delete mode 100644 spot_viz/launch/view_robot.launch create mode 100644 spot_viz/launch/view_robot.launch.py diff --git a/spot_description/CMakeLists.txt b/spot_description/CMakeLists.txt index 1ee8901f..8c1ed543 100644 --- a/spot_description/CMakeLists.txt +++ b/spot_description/CMakeLists.txt @@ -6,4 +6,8 @@ find_package(ament_cmake REQUIRED) install(DIRECTORY launch urdf meshes DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY urdf DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY meshes DESTINATION share/${PROJECT_NAME}) + ament_package() diff --git a/spot_description/launch/description.py b/spot_description/launch/description.launch.py similarity index 85% rename from spot_description/launch/description.py rename to spot_description/launch/description.launch.py index 8dcd6c94..a6d99b56 100644 --- a/spot_description/launch/description.py +++ b/spot_description/launch/description.launch.py @@ -7,8 +7,9 @@ import xacro def generate_launch_description(): - pkg_share = FindPackageShare('robot_state_publisher').find('robot_state_publisher') + pkg_share = FindPackageShare('spot_description').find('spot_description') urdf_dir = os.path.join(pkg_share, 'urdf') + print(f'urdf_dir: {urdf_dir}') xacro_file = os.path.join(urdf_dir, 'spot.urdf.xacro') doc = xacro.process_file(xacro_file) robot_desc = doc.toprettyxml(indent=' ') diff --git a/spot_driver/setup.py b/spot_driver/setup.py index 6ff43d9e..e43928a0 100644 --- a/spot_driver/setup.py +++ b/spot_driver/setup.py @@ -16,8 +16,8 @@ zip_safe=True, author='Dave Niewinski', author_email='dniewinski@clearpathrobotics.com', - maintainer='Dave Niewinski', - maintainer_email='dniewinski@clearpathrobotics.com', + maintainer='Austin Deric', + maintainer_email='Austin.Deric@gmail.com', keywords=['ROS'], classifiers=[ 'Intended Audience :: Developers', diff --git a/spot_viz/CMakeLists.txt b/spot_viz/CMakeLists.txt index fddc9562..e55e2c24 100644 --- a/spot_viz/CMakeLists.txt +++ b/spot_viz/CMakeLists.txt @@ -3,7 +3,7 @@ project(spot_viz) find_package(ament_cmake REQUIRED) -install(DIRECTORY launch rviz - DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) +install(DIRECTORY rviz DESTINATION share/${PROJECT_NAME}) ament_package() \ No newline at end of file diff --git a/spot_viz/launch/view_model.launch b/spot_viz/launch/view_model.launch deleted file mode 100644 index 9488a254..00000000 --- a/spot_viz/launch/view_model.launch +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/spot_viz/launch/view_model.launch.py b/spot_viz/launch/view_model.launch.py new file mode 100644 index 00000000..cda216dc --- /dev/null +++ b/spot_viz/launch/view_model.launch.py @@ -0,0 +1,24 @@ +from launch import LaunchDescription +from ament_index_python.packages import get_package_share_directory +from launch_ros.actions import Node +from launch.actions import IncludeLaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource + +import os + +def generate_launch_description(): + return LaunchDescription([ + Node( + package='joint_state_publisher_gui', + namespace='joint_state_publisher_gui', + executable='joint_state_publisher_gui', + name='joint_state_publisher_gui' + ), + IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join(get_package_share_directory('spot_description'), + 'launch', + 'description.launch.py') + ) + ) + ]) diff --git a/spot_viz/launch/view_robot.launch b/spot_viz/launch/view_robot.launch deleted file mode 100644 index d9facb1e..00000000 --- a/spot_viz/launch/view_robot.launch +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/spot_viz/launch/view_robot.launch.py b/spot_viz/launch/view_robot.launch.py new file mode 100644 index 00000000..410e572f --- /dev/null +++ b/spot_viz/launch/view_robot.launch.py @@ -0,0 +1,18 @@ +from launch import LaunchDescription +from ament_index_python.packages import get_package_share_directory +from launch_ros.actions import Node + +import os + +def generate_launch_description(): + bringup_dir = get_package_share_directory('spot_viz') + + return LaunchDescription([ + Node( + package='rviz', + namespace='rviz', + executable='rviz', + name='rviz', + arguments=['-d', os.path.join(bringup_dir,'rviz', 'robot.rviz"')] + ) + ]) From d996912d1b8e6214dcc20b3190f0d68ea9a6195a Mon Sep 17 00:00:00 2001 From: Austin Deric Date: Sun, 27 Dec 2020 14:30:38 -0600 Subject: [PATCH 7/7] remap joint state publisher --- spot_viz/launch/view_model.launch.py | 15 ++++++++++++++- spot_viz/launch/view_robot.launch.py | 18 ------------------ 2 files changed, 14 insertions(+), 19 deletions(-) delete mode 100644 spot_viz/launch/view_robot.launch.py diff --git a/spot_viz/launch/view_model.launch.py b/spot_viz/launch/view_model.launch.py index cda216dc..c2399f5c 100644 --- a/spot_viz/launch/view_model.launch.py +++ b/spot_viz/launch/view_model.launch.py @@ -7,12 +7,18 @@ import os def generate_launch_description(): + bringup_dir = get_package_share_directory('spot_viz') return LaunchDescription([ Node( package='joint_state_publisher_gui', namespace='joint_state_publisher_gui', executable='joint_state_publisher_gui', - name='joint_state_publisher_gui' + name='joint_state_publisher_gui', + remappings=[ + ('/joint_state_publisher_gui/joint_states', '/joint_states'), + ('/joint_state_publisher_gui/robot_description', '/robot_description'), + ('/joint_state_publisher_gui/parameter_events', '/parameter_events') + ] ), IncludeLaunchDescription( PythonLaunchDescriptionSource( @@ -20,5 +26,12 @@ def generate_launch_description(): 'launch', 'description.launch.py') ) + ), + Node( + package='rviz2', + namespace='rviz2', + executable='rviz2', + name='rviz2', + arguments=['-d', os.path.join(bringup_dir,'rviz', 'robot.rviz"')], ) ]) diff --git a/spot_viz/launch/view_robot.launch.py b/spot_viz/launch/view_robot.launch.py deleted file mode 100644 index 410e572f..00000000 --- a/spot_viz/launch/view_robot.launch.py +++ /dev/null @@ -1,18 +0,0 @@ -from launch import LaunchDescription -from ament_index_python.packages import get_package_share_directory -from launch_ros.actions import Node - -import os - -def generate_launch_description(): - bringup_dir = get_package_share_directory('spot_viz') - - return LaunchDescription([ - Node( - package='rviz', - namespace='rviz', - executable='rviz', - name='rviz', - arguments=['-d', os.path.join(bringup_dir,'rviz', 'robot.rviz"')] - ) - ])