0
$\begingroup$

Rosanswers logo

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 folder src. From src folder I did:

$ catkin_init_workspace

From workspace folder I did

$ catkin_make
$ echo "source ~/WorkSpaceMasteringRosRobot/devel/setup.bash" >> ~/.bashrc 
$ source ~/.bashrc

I created the package with catkin_create_pkg. Then I created folder like urdf, rviz and launch with above files. Then I do which now I think I don't have to do that again. Am I correct?

$ catkin_make
$ echo "source ~/WorkSpaceMasteringRosRobot/devel/setup.bash" >> ~/.bashrc 
$ source ~/.bashrc

Originally posted by Thang Nguyen on ROS Answers with karma: 93 on 2016-09-18

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by gvdhoorn with karma: 86574 on 2016-09-18

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Thang Nguyen on 2016-09-19:
Thanks gvdhoorn. I added Edit 1. Please take a look.

Comment by Thang Nguyen on 2016-09-19:
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.

Comment by gvdhoorn on 2016-09-19:
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.

Comment by Thang Nguyen on 2016-09-20:
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

Comment by Thang Nguyen on 2016-09-20:
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.

Comment by gvdhoorn on 2016-09-20:
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.

Comment by Thang Nguyen on 2016-09-20:
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.

Comment by gvdhoorn on 2016-09-20:
No problem. Take your time.

Comment by Thang Nguyen on 2016-09-21:
Have an extra r turns out that what I want which have different name with original installed package "shamed face" :) . It runs now. I just added r into tutorial in my launch file. Could you please tell me from scratch how can I make the rviz configure file?

Comment by gvdhoorn on 2016-09-21:
"from scratch"? Just start RViz with no config, then save the config to some location writeable by your user.

I would actually start with the urdf.rviz from urdf_tutorial, and then change to to your liking. Then save it to a location writeable by your user.

Comment by Thang Nguyen on 2016-09-21:
Thank you very much for your time helping me. It is very meaningful for newbie like me to have someone patiently answer all stupid questions :)

Comment by gvdhoorn on 2016-09-21:
No problem. Good to hear you got things to work.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.