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

WIP ROS2 Foxy branch #4

Closed
wants to merge 7 commits into from
Closed
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
17 changes: 17 additions & 0 deletions .github/workflows/ros2-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: ROS2 Colcon Build

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: ros-tooling/[email protected]
- uses: ros-tooling/[email protected]
with:
package-name: spot_ros
target-ros2-distro: foxy

17 changes: 8 additions & 9 deletions spot_description/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
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 share/${PROJECT_NAME})
install(DIRECTORY urdf DESTINATION share/${PROJECT_NAME})
install(DIRECTORY meshes DESTINATION share/${PROJECT_NAME})

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()
5 changes: 0 additions & 5 deletions spot_description/launch/description.launch

This file was deleted.

22 changes: 22 additions & 0 deletions spot_description/launch/description.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import os

import launch
import launch_ros.actions
from launch_ros.substitutions import FindPackageShare

import xacro

def generate_launch_description():
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=' ')
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])
10 changes: 7 additions & 3 deletions spot_description/package.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
<?xml version="1.0"?>
<package format="2">
<?xml-model href="http://download.ros.org/schema/package_format3.xsd"
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>spot_description</name>
<version>0.0.0</version>
<version>2.0.0</version>
<description>The spot_description package</description>

<maintainer email="[email protected]">Dave Niewinski</maintainer>

<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<exec_depend>robot_state_publisher</exec_depend>
<exec_depend>urdf</exec_depend>
<exec_depend>xacro</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>

</package>
23 changes: 0 additions & 23 deletions spot_driver/CMakeLists.txt

This file was deleted.

9 changes: 5 additions & 4 deletions spot_driver/package.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
<?xml version="1.0"?>
<package format="2">
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>spot_driver</name>
<version>0.0.0</version>
<version>2.0.0</version>
<description>The spot_driver package</description>

<maintainer email="[email protected]">Dave Niewinski</maintainer>

<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<exec_depend>rclpy</exec_depend>
<exec_depend>spot_msgs</exec_depend>
<exec_depend>std_srvs</exec_depend>
<exec_depend>tf2_msgs</exec_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>rospy</exec_depend>

<export>
<build_type>ament_python</build_type>
<rosdoc config="rosdoc.yaml" />
</export>
</package>
Empty file.
36 changes: 36 additions & 0 deletions spot_driver/setup.py
Original file line number Diff line number Diff line change
@@ -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='[email protected]',
maintainer='Austin Deric',
maintainer_email='[email protected]',
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',
],
},
)
File renamed without changes.
File renamed without changes.
70 changes: 30 additions & 40 deletions spot_msgs/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
4 changes: 2 additions & 2 deletions spot_msgs/msg/BatteryState.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion spot_msgs/msg/BehaviorFault.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion spot_msgs/msg/EStopState.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions spot_msgs/msg/Metrics.msg
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions spot_msgs/msg/PowerState.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions spot_msgs/msg/SystemFault.msg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 15 additions & 13 deletions spot_msgs/package.xml
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<?xml version="1.0"?>
<package format="2">
<?xml-model href="http://download.ros.org/schema/package_format3.xsd"
schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>spot_msgs</name>
<version>0.0.0</version>
<version>2.0.0</version>
<description>The spot_msgs package</description>

<maintainer email="[email protected]">Dave Niewinski</maintainer>
<license>BSD</license>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>nav_msgs</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<exec_depend>geometry_msgs</exec_depend>
<exec_depend>nav_msgs</exec_depend>
<exec_depend>sensor_msgs</exec_depend>
<exec_depend>std_msgs</exec_depend>
<buildtool_depend>ament_cmake</buildtool_depend>

<build_depend>message_generation</build_depend>
<exec_depend>message_runtime</exec_depend>
<depend>rclcpp</depend>
<depend>std_msgs</depend>
<depend>builtin_interfaces</depend>
<depend>rosidl_default_generators</depend>
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>
<depend>sensor_msgs</depend>

<member_of_group>rosidl_interface_packages</member_of_group>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
Empty file added spot_ros/CHANGELOG.rst
Empty file.
10 changes: 10 additions & 0 deletions spot_ros/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()
Loading