ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hi, I have managed to solve it like this, hope it will help to some one :), this just the piece of code that called the slot.

self._widget.autonomous.pressed.connect(self._load_launchfile_slot)

@Slot(str) def _load_launchfile_slot(self): launchfile_name = 'patrolbot_navigation.launch' folder_name_launchfile = 'launch' pkg_name = 'patrol_navigation'

    try:
         #launchfile = os.path.join(rospkg.RosPack().get_path(pkg_name), folder_name_launchfile, launchfile_name)
         #print( launchfile)
        args =  roslaunch.rlutil.resolve_launch_arguments([pkg_name, launchfile_name])
        rospy.loginfo("Starting task: %s"%args)
        runner = roslaunch.parent.ROSLaunchParent( rospy.get_param("/run_id"), args)
        runner.start()
    except IndexError as e:
        raise RLException('IndexError: {}'.format(e.message))

Hi, I have managed to solve it like this, hope it will help to some one :), this just the piece of code that called the slot.

self._widget.autonomous.pressed.connect(self._load_launchfile_slot)

 self._widget.autonomous.pressed.connect(self._load_launchfile_slot)
  

@Slot(str) def _load_launchfile_slot(self): @Slot(str) def _load_launchfile_slot(self): launchfile_name = 'patrolbot_navigation.launch' folder_name_launchfile = 'launch' pkg_name = 'patrol_navigation'

'patrol_navigation'
    try:
         #launchfile = os.path.join(rospkg.RosPack().get_path(pkg_name), folder_name_launchfile, launchfile_name)
         #print( launchfile)
        args =  roslaunch.rlutil.resolve_launch_arguments([pkg_name, launchfile_name])
        rospy.loginfo("Starting task: %s"%args)
        runner = roslaunch.parent.ROSLaunchParent( rospy.get_param("/run_id"), args)
        runner.start()
    except IndexError as e:
        raise RLException('IndexError: {}'.format(e.message))