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 offboard sensors package #17

Merged
merged 5 commits into from
Jan 13, 2025
Merged
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
1 change: 1 addition & 0 deletions clearpath_desktop/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<buildtool_depend>ament_cmake</buildtool_depend>

<exec_depend>clearpath_config_live</exec_depend>
<exec_depend>clearpath_offboard_sensors</exec_depend>
<exec_depend>clearpath_platform_msgs</exec_depend>
<exec_depend>clearpath_viz</exec_depend>

Expand Down
8 changes: 8 additions & 0 deletions clearpath_offboard_sensors/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
cmake_minimum_required(VERSION 3.5)
project(clearpath_offboard_sensors)
find_package(ament_cmake REQUIRED)

install(DIRECTORY config launch
DESTINATION share/${PROJECT_NAME}
)
ament_package()
10 changes: 10 additions & 0 deletions clearpath_offboard_sensors/config/velodyne_lidar.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/**:
ros__parameters:
calibration: /opt/ros/jazzy/share/velodyne_pointcloud/params/VLP16db.yaml
max_range: 130.0
min_range: 0.9
organize_cloud: true
view_direction: 0.0
model: VLP16
fixed_frame: lidar3d_0_laser
target_frame: lidar3d_0_laser
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Software License Agreement (BSD)
#
# @author Roni Kreinin <rkreinin@clearpathrobotics.com>
# @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
namespace = LaunchConfiguration('namespace')
in_compressed = LaunchConfiguration('in_compressed')
out_raw = LaunchConfiguration('out_raw')

arg_namespace = DeclareLaunchArgument(
'namespace',
default_value=''
)

arg_in_compressed = DeclareLaunchArgument(
'in_compressed',
default_value='compressed'
)

arg_out_raw = DeclareLaunchArgument(
'out_raw',
default_value='image'
)

compressed_transport_node = Node(
name='image_compressed_to_raw',
namespace=namespace,
package='image_transport',
executable='republish',
remappings=[
('in/compressed', in_compressed),
('out', out_raw),
],
arguments=['compressed', 'raw'],
)

ld = LaunchDescription()
ld.add_action(arg_namespace)
ld.add_action(arg_in_compressed)
ld.add_action(arg_out_raw)
ld.add_action(compressed_transport_node)
return ld
72 changes: 72 additions & 0 deletions clearpath_offboard_sensors/launch/image_ffmpeg_to_raw.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Software License Agreement (BSD)
#
# @author Hilary Luo <hluo@clearpathrobotics.com>
# @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
namespace = LaunchConfiguration('namespace')
in_ffmpeg = LaunchConfiguration('in_ffmpeg')
out_raw = LaunchConfiguration('out_raw')

arg_namespace = DeclareLaunchArgument(
'namespace',
default_value=''
)

arg_in_ffmpeg = DeclareLaunchArgument(
'in_ffmpeg',
default_value='ffmpeg'
)

arg_out_raw = DeclareLaunchArgument(
'out_raw',
default_value='image'
)

ffmpeg_transport_node = Node(
name='image_ffmpeg_to_raw',
namespace=namespace,
package='image_transport',
executable='republish',
remappings=[
('in/ffmpeg', in_ffmpeg),
('out', out_raw),
],
arguments=['ffmpeg', 'raw'],
)

ld = LaunchDescription()
ld.add_action(arg_namespace)
ld.add_action(arg_in_ffmpeg)
ld.add_action(arg_out_raw)
ld.add_action(ffmpeg_transport_node)
return ld
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Software License Agreement (BSD)
#
# @author Roni Kreinin <rkreinin@clearpathrobotics.com>
# @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
namespace = LaunchConfiguration('namespace')
in_raw = LaunchConfiguration('in_raw')
out_compressed = LaunchConfiguration('out_compressed')

arg_namespace = DeclareLaunchArgument(
'namespace',
default_value=''
)

arg_in_raw = DeclareLaunchArgument(
'in_raw',
default_value='image'
)

arg_out_compressed = DeclareLaunchArgument(
'out_compressed',
default_value='compressed'
)

compressed_transport_node = Node(
name='image_raw_to_compressed',
namespace=namespace,
package='image_transport',
executable='republish',
remappings=[
('in', in_raw),
('out/compressed', out_compressed),
],
arguments=['raw', 'compressed'],
)

ld = LaunchDescription()
ld.add_action(arg_namespace)
ld.add_action(arg_in_raw)
ld.add_action(arg_out_compressed)
ld.add_action(compressed_transport_node)
return ld
74 changes: 74 additions & 0 deletions clearpath_offboard_sensors/launch/image_raw_to_ffmpeg.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Software License Agreement (BSD)
#
# @author Hilary Luo <hluo@clearpathrobotics.com>
# @copyright (c) 2024, Clearpath Robotics, Inc., All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


ARGUMENTS = [
DeclareLaunchArgument('namespace', default_value=''),
DeclareLaunchArgument('in_raw', default_value='image'),
DeclareLaunchArgument('out_ffmpeg', default_value='ffmpeg'),
DeclareLaunchArgument('encoding', default_value='libx264'),
DeclareLaunchArgument('qmax', default_value='40'),
DeclareLaunchArgument('preset', default_value='superfast'),
DeclareLaunchArgument('tune', default_value='zerolatency'),
DeclareLaunchArgument('bit_rate', default_value='1000000'),
DeclareLaunchArgument('gop_size', default_value='15'),
]


def generate_launch_description():
namespace = LaunchConfiguration('namespace')
in_raw = LaunchConfiguration('in_raw')
out_ffmpeg = LaunchConfiguration('out_ffmpeg')

ffmpeg_transport_node = Node(
name='image_raw_to_ffmpeg',
namespace=namespace,
package='image_transport',
executable='republish',
remappings=[
('in', in_raw),
('out/ffmpeg', out_ffmpeg),
],
arguments=['raw', 'ffmpeg'],
parameters=[
{'ffmpeg_image_transport.encoding': LaunchConfiguration('encoding')},
{'ffmpeg_image_transport.qmax': LaunchConfiguration('qmax')},
{'ffmpeg_image_transport.preset': LaunchConfiguration('preset')},
{'ffmpeg_image_transport.tune': LaunchConfiguration('tune')},
{'ffmpeg_image_transport.bit_rate': LaunchConfiguration('bit_rate')},
{'ffmpeg_image_transport.gop_size': LaunchConfiguration('gop_size')}],
)

ld = LaunchDescription(ARGUMENTS)
ld.add_action(ffmpeg_transport_node)
return ld
71 changes: 71 additions & 0 deletions clearpath_offboard_sensors/launch/image_raw_to_theora.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Software License Agreement (BSD)
#
# @author Roni Kreinin <rkreinin@clearpathrobotics.com>
# @copyright (c) 2023, Clearpath Robotics, Inc., All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of Clearpath Robotics nor the names of its contributors
# may be used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch_ros.actions import Node


def generate_launch_description():
namespace = LaunchConfiguration('namespace')
in_raw = LaunchConfiguration('in_raw')
out_theora = LaunchConfiguration('out_theora')

arg_namespace = DeclareLaunchArgument(
'namespace',
default_value=''
)

arg_in_raw = DeclareLaunchArgument(
'in_raw',
default_value='image'
)

arg_out_theora = DeclareLaunchArgument(
'out_theora',
default_value='theora'
)

theora_transport_node = Node(
name='image_raw_to_theora',
namespace=namespace,
package='image_transport',
executable='republish',
remappings=[
('in', in_raw),
('out/theora', out_theora),
],
arguments=['raw', 'theora'],
)

ld = LaunchDescription()
ld.add_action(arg_namespace)
ld.add_action(arg_in_raw)
ld.add_action(arg_out_theora)
ld.add_action(theora_transport_node)
return ld
Loading