Ask Your Question
0

How to run a node on the command line instead of from a launch file

asked 2019-12-23 20:12:19 -0600

Avner gravatar image

Hi,

I have a roslaunch scripts that launches several nodes.
I want to debug one of the nodes, that maps to an executable, with qtc (or gdb). For example, place a breakpoint at a specific line.
I thought to:
- open the node seperatly in qtc and build it
- kill the original node that was launched from the launch file
- run the executable via qtc, with the same arguments that I the original node runs with.

To find the arguments that the original node runs with I do:

ps aux | grep moveit_interface_node
avnerm   22192  0.3  0.9 1052892 75676 ?       Ssl  17:28   0:06 /home/avnerm/interbotix_ws/devel/lib/interbotix_moveit_interface/moveit_interface_node __name:=moveit_interface_node __log:=/home/avnerm/.ros/log/ab204e42-25ec-11ea-9d6e-74d02b912ce1/rx150-moveit_interface_node-9.log

I kill the original process

kill -9 22192

Before running via qtc, I want to run the node directly from the command line (not via roslaunch)

/home/avnerm/interbotix_ws/devel/lib/interbotix_moveit_interface/moveit_interface_node __name:=moveit_interface_node __log:=/home/avnerm/.ros/log/ab204e42-25ec-11ea-9d6e-74d02b912ce1/rx150-moveit_interface_node-9.log

But I am get a runtime error: "Robot model parameter not found! Did you remap 'robot_description'?"
In the launch file, there is a namespace parameter ns="$(arg robot_name)"
This parameter is not shown in the process list (when doing "ps aux | grep moveit_interface_node")
I suspect that this is setting is missing when running directly in the command line.

  <node
    name="moveit_interface_node"
    pkg="interbotix_moveit_interface"
    type="moveit_interface_node"
    respawn="false"
    output="log"
    ns="$(arg robot_name)"/>

How can I run the node in the command line (and following that in qtc for debugging purposes)?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-12-23 20:28:02 -0600

Avner gravatar image

adding the parameter __ns:=rx150 solved the problem

/home/avnerm/interbotix_ws/devel/lib/interbotix_moveit_interface/moveit_interface_node \
 __name:=moveit_interface_node \
 __log:=/home/avnerm/.ros/log/ab204e42-25ec-11ea-9d6e-74d02b912ce1/rx150-moveit_interface_node-9.log \
 __ns:=rx150
edit flag offensive delete link more

Comments

It may be easier to use the launch-prefix attribute in your .launch file. See How to Roslaunch Nodes in Valgrind or GDB.

gvdhoorn gravatar imagegvdhoorn ( 2019-12-24 03:24:40 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-12-23 20:12:19 -0600

Seen: 21 times

Last updated: Dec 23 '19