Skip to content

Commit

Permalink
Add launch file for cerebri.
Browse files Browse the repository at this point in the history
Signed-off-by: James Goppert <[email protected]>
  • Loading branch information
jgoppert committed May 19, 2023
1 parent b7ef664 commit 7cd5501
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
21 changes: 21 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.8)
project(cerebri_bringup)
find_package(ament_cmake REQUIRED)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# find dependencies
find_package(ament_cmake REQUIRED)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
#set(ament_cmake_copyright_FOUND TRUE)
#set(ament_cmake_cpplint_FOUND TRUE)
ament_lint_auto_find_test_dependencies()
endif()

install(DIRECTORY launch DESTINATION share/${PROJECT_NAME})

ament_package()
28 changes: 28 additions & 0 deletions launch/cerebri.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from os import environ
from ament_index_python.packages import get_package_share_directory

from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.actions import Node
from launch.actions import ExecuteProcess


ARGUMENTS = [
]

def generate_launch_description():

cerebri_bin = environ.get('CEREBRI_BINARY')
cerebri_cmd = f"{cerebri_bin} -attach_uart_cmd='xterm -fg white -bg black -e screen %s &'"
cerebri = LaunchDescription([
ExecuteProcess(
cmd=cerebri_cmd.split(),
output="log",
shell=True),
])

return LaunchDescription(ARGUMENTS + [
cerebri,
])
18 changes: 18 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>cerebri_bringup</name>
<version>0.0.0</version>
<description>Cerebri launch files</description>
<maintainer email="[email protected]">cogni</maintainer>
<license>Apache 2.0</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<test_depend>ament_lint_auto</test_depend>
<test_depend>ament_lint_common</test_depend>

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

0 comments on commit 7cd5501

Please sign in to comment.