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

dd_robot2.urdf help

asked 2018-02-02 22:28:00 -0600

MechLc gravatar image

updated 2018-02-04 02:01:08 -0600

Hi I am reading "ROS ROBOTICS BY EXAMPLE SECOND EDITION " and I am stuck in chapter 2 , when it introduces the dd_robot2.urdf. What I am getting is the image blow C:\fakepath\robot.png

but the book has this instead: C:\fakepath\Screenshot from 2018-02-02 20-25-48.png

I followed the book step by step and I cant figure out where I went wrong. Any help? Thank you!

EDIT1:

C:\fakepath\Screenshot from 2018-02-02 22-44-55.png

EDIT 2:

Launch File:

<launch>
   <!-- values passed by command line input -->     
   <arg name="model" />
   <arg name="gui" default="False" />

   <!-- set these parameters on Parameter Server -->
   <param name="robot_description" textfile="$(find ros_robotics)/urdf/$(arg model)" />
   <param name="use_gui" value="$(arg gui)"/>

   <!-- Start 3 nodes: joint_state_publisher, robot_state_publisher and rviz -->
   <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 $(find ros_robotics)/urdf.rviz" required="true" />
   <!-- (required = "true") if rviz dies, entire roslaunch will be killed -->
</launch>

URDF File:

<?xml version='1.0'?>
<robot name="dd_robot">

  <!-- Base Link -->
  <link name="base_link">
    <visual>
      <origin xyz="0 0 0" rpy="0 0 0" />
      <geometry>
          <box size="0.5 0.5 0.25"/>
      </geometry>
    </visual>
  </link>

  <!-- Right Wheel -->
  <link name="right_wheel">
    <visual>
      <origin xyz="0 0 0" rpy="1.570795 0 0" />
      <geometry>
          <cylinder length="0.1" radius="0.2" />
      </geometry>
    </visual>
  </link>
  <joint name="joint_right_wheel" type="continuous">
    <parent link="base_link"/>
    <child link="right_wheel"/>
    <origin xyz="0 -0.30 0" rpy="0 0 0" /> 
    <axis xyz="0 1 0" />
  </joint>

  <!-- Left Wheel -->
  <link name="left_wheel">
    <visual>
      <origin xyz="0 0 0" rpy="1.570795 0 0" />
      <geometry>
          <cylinder length="0.1" radius="0.2" />
      </geometry>
    </visual>
  </link>
  <joint name="joint_left_wheel" type="continuous">
    <parent link="base_link"/>
    <child link="left_wheel"/>
    <origin xyz="0 0.30 0" rpy="0 0 0" /> 
    <axis xyz="0 1 0" />
  </joint>

</robot>

Command on terminal:

$ roslaunch ros_robotics ddrobot_rviz.launch model:=dd_robot2.urdf

Edit3:

image description

edit retag flag offensive close merge delete

Comments

RViz says that there's a tf problem. Can you update your question with a screen shot of your tf tree?

jayess gravatar image jayess  ( 2018-02-03 16:53:52 -0600 )edit

It has been updated in Edit1 screenshot

MechLc gravatar image MechLc  ( 2018-02-03 16:56:01 -0600 )edit

That's a screen shot of RViz. I'm asking for your tf tree

jayess gravatar image jayess  ( 2018-02-03 16:57:45 -0600 )edit

When I use your launch file (removing references to your ros_robotics package) everything loads fine and I can visualize the model just as in the book.

jayess gravatar image jayess  ( 2018-02-03 17:02:18 -0600 )edit

strange my doesnt load up like that. Let me screen shot my TF tree.

MechLc gravatar image MechLc  ( 2018-02-04 01:44:52 -0600 )edit

How do i run the TF Tree?

MechLc gravatar image MechLc  ( 2018-02-04 01:54:22 -0600 )edit

It's in the tutorial I linked to in an earlier comment

jayess gravatar image jayess  ( 2018-02-04 01:58:21 -0600 )edit

I updated it with screenshot seems not work when i used rosrun tf view_frames

MechLc gravatar image MechLc  ( 2018-02-04 02:02:01 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-02-03 00:23:34 -0600

ahendrix gravatar image

It looks like you don't have a TF publisher running, or you don't have the right frame selected in rviz.

You should double-check your rviz settings and make sure the robot_state_publisher node is running to publish the TF transforms from your URDF.

edit flag offensive delete link more

Comments

I tried that and still doesnt seem to work. I ran the robot_state_publisher node did not fix the issue. take a look at my EDIT 1: screen shot to see if I missed anything. Thanks for your time

MechLc gravatar image MechLc  ( 2018-02-03 00:42:25 -0600 )edit

Your screenshot shows an rviz error "no TF data". Was robot_state_publisher still running when you took your screenshots?

ahendrix gravatar image ahendrix  ( 2018-02-03 00:44:22 -0600 )edit

I got this message when i ran it: : Shutdown request received. : Reason given for shutdown: [new node registered with same name]

MechLc gravatar image MechLc  ( 2018-02-03 00:49:21 -0600 )edit
1

Do you have a launch file running that is running another copy of robot_state_publisher ? Nodes don't normally shut down like that unless there's another copy running somewhere.

ahendrix gravatar image ahendrix  ( 2018-02-03 13:47:03 -0600 )edit
1

It seems like you've left some of the details out of your question. I'm not very familiar with the book you're using, and without all of the details about which other nodes you're running, it's difficult to help.

ahendrix gravatar image ahendrix  ( 2018-02-03 13:47:44 -0600 )edit

I added the launch file and URDF code up at the top for you to take a look at if i am missing anything? The book is called "ROS ROBOTICS BY EXAMPLE SECOND EDITION" by Carol Fairchild, Dr. Thomas L. Harman

MechLc gravatar image MechLc  ( 2018-02-03 14:00:03 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-02-02 22:28:00 -0600

Seen: 446 times

Last updated: Feb 04 '18