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

How to force update after updating urdf file?

asked 2016-09-18 03:24:53 -0500

Thang Nguyen gravatar image

updated 2016-09-20 08:42:45 -0500

Hi, I am following this tutorial Building a Visual Robot Model with URDF from Scratch

I am working on the third urdf file 03-origins.urdf.

After testing with the file in tutorial, I modified the position of right_leg, or changing the name of right_leg -> left_leg (included name in the joint section), these modifies are still not be updated when I ran the launch file. The robot model still look the same with the first time I ran the file or the information of the link inside robot model in Displays view on the left side of rviz is still the same.

Please tell me the steps to have my modification be updated in rviz. I did try to run catkin_make again but it did not help.

My another question is looks like rviz does not load the urdf.rviz file at all. Every time I ran, I have to add the robot model manually and I also have to set the Fixed Frame under Global Options to base_link. I tried to save the urdf configuration but it shows a dialog says "Failed to save", and ask me to save to another file.

Thank you very much.

Edit 1: From what I have right now, I do Ctrl+C to close the current roslaunch session.

Below is my modified urdf file. I changed the name of the child link to "left_leg" as well as I change the position to only shift -0.3

<?xml version="1.0"?>
<robot name="myfirst">
    <link name = "base_link">
        <visual>
            <geometry>
                <cylinder length="0.6" radius="0.2"/>
            </geometry>
        </visual>
    </link>

    <link name = "left_leg">
        <visual>
            <geometry>
                <box size="0.6 .1 .2" />
            </geometry>
            <origin rpy="0 0 0" xyz="0 0 -0.3" />
        </visual>
    </link>

    <joint  name="base_to_left_leg" type="fixed">
        <parent link="base_link"/>
        <child link="left_leg"/>
    </joint>
</robot>

The issue can come from my modified launch file. I removed the model argument.

<launch>
  <arg name="gui" default="true" />
  <arg name="rvizconfig" default="$(find urdf_tutorial)/rviz/urdf.rviz" />
  <arg name="urdfconfig" default="$(find urdf_tutorial)/urdf/03-origins.urdf" />

  <param name="robot_description" textfile="$(arg urdfconfig)" />
  <param name="use_gui" value="$(arg gui)"/>

  <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
</launch>

I did try to put it back as original launch file and I got the error

ubuntu@tegra-ubuntu:~/Documents/WorkSpaceMasteringRosRobot$ roslaunch urdf_turtorial display.launch model:=urdf/03-origins.urdf
... logging to /home/ubuntu/.ros/log/66b5c9da-7e4c-11e6-b9fc-00044b581868/roslaunch-tegra-ubuntu-16126.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

<param> tag must have one and only one of value/textfile/binfile.
The traceback for the exception was written to the log file

I also attach the screen shot of rvizScreenshot rviz.png Please notice at RobotModel > Links > right_leg

Edit 2: I used the same workspace which I already created with another project. I create the workspace folder then sub ... (more)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-09-18 05:29:24 -0500

gvdhoorn gravatar image

updated 2016-09-20 09:14:48 -0500

Restarting RViz after updating the robot_description parameter should be enough to make RViz display your updated URDF.

Typical workflow:

  1. edit urdf
  2. save
  3. stop rviz (when started using display.launch from urdf_tutorial, just ctrl+c the roslaunch session)
  4. restart rviz (or, roslaunch urdf_tutorial display.launch model:=..

If that does not work for you, please edit your original question, and show us the exact steps you use in your edit/reload cycle. Don't skip anything.


PS: actually, if you update the robot_description parameter, just dis- and enabling the Robot Model display should also result in it displaying the new urdf, but that only works for RViz and that particular plugin.


Edit:

From what I have right now, I do Ctrl+C to close the current roslaunch session

That should be enough to take everything down. You don't have any roscore running somewhere in the background (in another shell/terminal)?

I tried to save the urdf configuration but it shows a dialog says "Failed to save", and ask me to save to another file.

Do you have the urdf_tutorial package cloned into your catkin workspace, or did you sudo apt-get install .. it? If the latter, then the RViz configuration is located in a non-writeable directory, which would explain why you can't overwrite it.

If 03-origins.urdf is also not in your workspace (but in /opt/ros/..) then you cannot save there either. That could also explain why you can't load an updated version of the URDF.

What is the output of rospack find urdf_tutorial?


Edit2:

Output of rospack find urdf_tutorial is

/opt/ros/indigo/share/urdf_tutorial

This means that ROS is not using your version of urdf_tutorial, but the system-installed version. Any changes you make/made to the package in your workspace will not be used/reflected in RViz, simply because the workspace copy of urdf_tutorial is not being used at all.

Can you please edit your question and tell us how you setup your workspace, how you build it and which files you source (ie: source /path/to/catkin_ws/devel/setup.bash or something else)?


Edit3: your workspace setup is fine.

Taking a careful look at your package, I noticed that package.xml has this (here):

<package>
  <name>urdf_turtorial</name>
  ...

Note the extra r. The name of the package you're trying to overlay is actually urdf_tutorial. Your CMakeLists.txt has the same problem (here).

Can you change the name in the manifest, rebuild your workspace and then try again rospack find urdf_tutorial? If rospack still can't find the workspace copy, please do a rospack profile. Then try again.

I expect things will start working as soon as you fix this.

edit flag offensive delete link more

Comments

Thanks gvdhoorn. I added Edit 1. Please take a look.

Thang Nguyen gravatar image Thang Nguyen  ( 2016-09-19 04:54:34 -0500 )edit

I didn't clone or install the package either. I created the work space, then created the package by myself. Then I copied the requirement files into my package like the urdf file, launch file, rviz configure file. My work space is stayed inside the Documents folder.

Thang Nguyen gravatar image Thang Nguyen  ( 2016-09-19 09:03:36 -0500 )edit

Can you make that package available somewhere? Through Github, or some other means?

What you describe should just work, so I'm not entirely sure where things are going wrong. Not being able to save files points to permission problems, so make sure those are correct.

gvdhoorn gravatar image gvdhoorn  ( 2016-09-19 09:25:24 -0500 )edit

Output of rospack find urdf_tutorial is

/opt/ros/indigo/share/urdf_tutorial

This is my first time using github, if there is anything wrong please let me know: urdf_tutorial

Thang Nguyen gravatar image Thang Nguyen  ( 2016-09-20 05:03:57 -0500 )edit

This is interesting. As I understand since my package has the same name with the installed package so it ran the installed packaged. I edited my question. Thank you very much.

Thang Nguyen gravatar image Thang Nguyen  ( 2016-09-20 08:43:16 -0500 )edit

Have you tried correcting the name of your package as I suggested? Has that solved the issue?

As I understand since my package has the same name with the installed package so it ran the installed packaged.

No: your pkg had the wrong name, so ROS ran the system installed pkg. Not yours.

gvdhoorn gravatar image gvdhoorn  ( 2016-09-20 09:36:37 -0500 )edit

I don't have access to my ROS system now. I can only work on this very early in the morning. I will update you tomorrow. Thanks.

Thang Nguyen gravatar image Thang Nguyen  ( 2016-09-20 09:59:58 -0500 )edit

No problem. Take your time.

gvdhoorn gravatar image gvdhoorn  ( 2016-09-20 10:15:47 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-09-18 03:24:53 -0500

Seen: 3,146 times

Last updated: Sep 20 '16