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

How can I stop printing statements from moveit_commander Python?

asked 2019-11-24 15:58:26 -0500

mkb_10062949 gravatar image

updated 2022-01-22 16:10:11 -0500

Evgeny gravatar image

Hi, I have a code here made using moveit_commander and I am using RL for training a UR5. I obtain pose and joint angle values by running the moveit_commander interface and publishing those values in a rostopic so that I can subscribe it in my environment. But due to the training overload, the publishers seem to crash and the whole training process stops. My idea is to somehow incorporate the moveit_commander within the environment itself so that I can get rid of publishers and subscribers. The problem with moveit-commander is that whenever you initialze the moveit_cmmander interface and run the python code it starts printing these statements.

[ INFO] [1574631433.496141382]: Loading robot model 'ur5_r2'...
[ WARN] [1574631433.497492371]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
[ INFO] [1574631433.497565114]: No root/virtual joint specified in SRDF. Assuming fixed joint
[ INFO] [1574631433.696682137, 7.780000000]: Loading robot model 'ur5_r2'...
[ WARN] [1574631433.696776037, 7.782000000]: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
[ INFO] [1574631433.696798683, 7.782000000]: No root/virtual joint specified in SRDF. Assuming fixed joint

I somehow want to edit this and stop printing these boiler statements. Is there a way to do this? because these statements will significantly slower the training process.

edit retag flag offensive close merge delete

Comments

gvdhoorn gravatar image gvdhoorn  ( 2019-11-25 04:05:20 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2019-11-24 18:56:49 -0500

jordan gravatar image

updated 2019-11-25 08:25:00 -0500

See here:

http://wiki.ros.org/roscpp/Overview/L...

In brief:

Set...

export ROSCONSOLE_FORMAT='${logger}: ${message}'

Now you can see which nodes the messages are coming from. Then...

sudo vi ~/.rosconsole.yaml

Add the following:

log4j.logger.ros=DEBUG

Then back at the command line:

export ROSCONSOLE_CONFIG_FILE=~/.rosconsole.yaml

This will turn on ALL debugging! But...

To turn off debugging on over-zealous nodes, add them to the ~/.rosconsole.yaml file, like this:

log4j.logger.ros.roscpp=INFO

Now DEBUG statements for roscpp will not be seen. You can suppress any number of nodes by just adding more lines to the file. You can get quite specific, eg.

 log4j.logger.ros.move_base.pluginlib.ClassLoader=INFO
edit flag offensive delete link more

Comments

Hi thank you for your answer, unfortunately it didin't work.

mkb_10062949 gravatar image mkb_10062949  ( 2019-11-25 03:05:13 -0500 )edit

Do you have any other suggestions please?

mkb_10062949 gravatar image mkb_10062949  ( 2019-11-25 03:05:46 -0500 )edit

export ROSCONSOLE_FORMAT='${logger}: ${message}'

You mentioned that I will get the nodes which are printing the messages but I ran this line and didn't get anythin

mkb_10062949 gravatar image mkb_10062949  ( 2019-11-25 03:07:12 -0500 )edit

Did you just run the command and expected to have the infos or do you have launched your nodes again and checked the output ? (also did you ensure to run them in the same terminal ?)

Delb gravatar image Delb  ( 2019-11-25 03:30:07 -0500 )edit

@jordan's answer is correct, personnaly I don't export the variable I prefer to do it in the launch file for more clarity, at the begging you can add this line :

<env name="ROSCONSOLE_CONFIG_FILE"  value="PATH_TO_YOUR_CONFIG_FILE"/>
Delb gravatar image Delb  ( 2019-11-25 03:33:24 -0500 )edit

Okay i found it, the messages are coming from ros.moveit_core.robot_model what is the syntax to add this to the rosconsole.yaml file ? I mean how should write it?

mkb_10062949 gravatar image mkb_10062949  ( 2019-11-25 03:52:23 -0500 )edit

That's exactly the smae output as ${logger}, with the logger prefix, set it to any logger level above INFO ( WARN, ERROR or FATAL) :

log4j.logger.ros.moveit_core.robot_model=WARN
Delb gravatar image Delb  ( 2019-11-25 03:58:18 -0500 )edit

okay I did this and I exported, I also tried exporting the logger value as FATAL and ERROR but it still prints these statements

ros.moveit_core.robot_model: Loading robot model 'ur5_r2'...
ros.moveit_core.robot_model: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
ros.moveit_core.robot_model: No root/virtual joint specified in SRDF. Assuming fixed joint
ros.moveit_core.robot_model: Loading robot model 'ur5'...
ros.moveit_core.robot_model: Skipping virtual joint 'fixed_base' because its child frame 'base_link' does not match the URDF frame 'world'
ros.moveit_core.robot_model: No root/virtual joint specified in SRDF. Assuming fixed joint
mkb_10062949 gravatar image mkb_10062949  ( 2019-11-25 04:09:24 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-11-24 15:58:26 -0500

Seen: 407 times

Last updated: Nov 25 '19