From f01e80de8d0b46037c605688cf742c154d0dad1f Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Mon, 13 May 2024 07:03:40 +0200 Subject: [PATCH] Prepare general launch file to launch all robotem rovne application nodes with one command. --- CMakeLists.txt | 1 + docker/docker-run.sh | 7 +++++-- docker/run.sh | 2 +- launch/all.py | 22 ++++++++++++++++++++++ 4 files changed, 29 insertions(+), 3 deletions(-) create mode 100644 launch/all.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 3a76d7f..91bf4e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,7 @@ ament_target_dependencies(${ROBOTEM_ROVNE_TARGET} rclcpp std_msgs std_srvs) ament_export_dependencies(rosidl_default_runtime) ####################################################################################### install(TARGETS ${ROBOTEM_ROVNE_TARGET} DESTINATION lib/${PROJECT_NAME}) +install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}) ####################################################################################### ament_package() ####################################################################################### diff --git a/docker/docker-run.sh b/docker/docker-run.sh index bc83449..ec115fc 100644 --- a/docker/docker-run.sh +++ b/docker/docker-run.sh @@ -37,7 +37,10 @@ ifconfig $CAN txqueuelen 1000 sudo -u fio ifconfig $CAN docker run -it \ - -u 0 \ - --privileged \ + --ulimit nofile=1024:1024 \ + --rm \ + -u 0 --privileged \ + --device /dev/spidev0.0 \ + -v /sys/class/gpio:/sys/class/gpio \ --network host \ robotem_rovne_docker $1 diff --git a/docker/run.sh b/docker/run.sh index f79cfa9..9a15ad5 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -8,5 +8,5 @@ colcon build --packages-select robotem_rovne cd /tmp/colcon_ws . install/setup.sh robotem_rovne -#ros2 launch t07_robot t07_4wd.py & +ros2 launch robotem_rovne all.py #ros2 launch pika_spark_bno085_driver imu.py & diff --git a/launch/all.py b/launch/all.py new file mode 100644 index 0000000..e504e84 --- /dev/null +++ b/launch/all.py @@ -0,0 +1,22 @@ +import os + +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 + +def generate_launch_description(): + + pkg_imu = get_package_share_directory('pika_spark_bno085_driver') + imu = IncludeLaunchDescription( + PythonLaunchDescriptionSource(os.path.join(pkg_imu, 'launch', 'imu.py')) + ) + + # Launch them all! + return LaunchDescription([ + imu + ])