Cannot launch a node in a launch file but I can run the file manually

asked 2019-11-07 04:29:43 -0600

mkb_10062949 gravatar image

Hi I am trying to run a python file that has a node defined. When I run the launch file without the node and then individually the run the python file by doing "cd" and going into the directory and then running the file manually say ./action_move2.py the file runs perfectly. But, when I try to give it as a node in the launch file itself i.e. <node name="action_move_robot1" pkg="rl_two_ur5" type="action_move_r1.py"/> it throws an error which is given below

Traceback (most recent call last):
  File "/home/murtaza/catkin_ws/src/rl_two_ur5/moveit_scripts/action_move_r1.py", line 97, in <module>
    group = moveit_commander.MoveGroupCommander(group_name, "robot2/robot_description", ns= "robot2")
  File "/opt/ros/melodic/lib/python2.7/dist-packages/moveit_commander/move_group.py", line 52, in __init__
    self._g = _moveit_move_group_interface.MoveGroupInterface(name, robot_description, ns)
RuntimeError: Unable to connect to move_group action server 'move_group' within allotted time (5s)

[robot1/action_move_robot1-16] process has died [pid 20769, exit code 1, cmd /home/murtaza/catkin_ws/src/rl_two_ur5/moveit_scripts/action_move_r1.py follow_joint_trajectory:=arm_controller/follow_joint_trajectory __name:=action_move_robot1 __log:=/home/murtaza/.ros/log/9ace48d0-0145-11ea-abef-000c29544a54/robot1-action_move_robot1-16.log].
log file: /home/murtaza/.ros/log/9ace48d0-0145-11ea-abef-000c29544a54/robot1-action_move_robot1-16*.log

I have already given the execution permission to the file and have checked the spelling mistakes there aren't any.

edit retag flag offensive close merge delete