Results 1 to 1 of 1

Thread: ROS2 launch issue when using .desktop file

  1. #1
    Join Date
    Jun 2024

    ROS2 launch issue when using .desktop file

    I am having an odd problem and hoping someone can assist. I am using Ubuntu desktop 22.04 and ROS2 humble. I have a TOF camera that I am setting up for a project. Currently I have the camera drivers installed and working and I can view the topics in RVIZ2 locally and on a remote machine.

    The issue is, I have written a simple bash script to source the environment and call the ros2 launch file and this works great if I open a terminal and call the script. I have also created a .desktop file to call the script and it open as terminal and appears to work but I cannot access the topics in RVIZ2. I cannot see where the issue would be why it would work one way but not the other, any help is appreciated. I have included a copy of the script and .desktop file below. FYI I have tried the desktop file with terminal true and not using gnome-terminal as well as not calling the script and adding it all to the exec and they all act the same way.
    #! /bin/bash
    source /opt/ros/humble/setup.bash
    source /home/lidar/lidar_ws/src/install/setup.bash
    echo -e "\033[6;32mLaunching ROS camera drivers, Please wait....\n\n\\033[0m"
    ros2 launch synexens_ros2
    .desktop file:
    [Desktop Entry]
    Name=ROS PointCloud
    Exec=gnome-terminal -e "bash -c '/home/lidar/;$SHELL'"
    Last edited by deadflowr; 4 Weeks Ago at 06:38 PM. Reason: cleaned font size, added code tags


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts