#! /usr/bin/env python3
import subprocess
import rospy
import os

file_path = "moveitServer2"
script_directory = os.path.dirname(os.path.abspath(__file__))

def load_rviz():
    command = "roslaunch lstrobot_moveit_config_0605 demo.launch"
    subprocess.Popen(['gnome-terminal', '--', 'bash', '-c', command])
def launch_publish_pointcloud():
    file_name = "dycl_0506.py"
    absolute_path = os.path.join(script_directory, file_name)
    command = "python3 {}".format(absolute_path)
    subprocess.Popen(['gnome-terminal', '--', 'bash', '-c', command])
def launch_moveit_control_server():
    file_name = "moveitServer2.py"
    absolute_path = os.path.join(script_directory, file_name)
    command = "python3 {}".format(absolute_path)
    subprocess.Popen(['gnome-terminal', '--', 'bash', '-c', command])

def launch_publish_pointcloud_background():
    file_name = "dycl_0506.py"
    absolute_path = os.path.join(script_directory, file_name)
    command = ["python3", absolute_path]
    subprocess.call(command)
def launch_moveit_control_server_background():
    file_name = "moveitServer2.py"
    absolute_path = os.path.join(script_directory, file_name)
    command = ["python3", absolute_path]
    subprocess.call(command)