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

Ros::InvalidNameException on negative radian limit value [Closed]

asked 2016-07-04 07:43:32 -0500

karlhm76 gravatar image

updated 2016-07-06 02:47:06 -0500

Hello,

I am at the stage where I can set up moveit and do some motion planning on my custom robot model.

I have executed the moveit setup assistant and specified the URDF with no problems. I generated the package, made it, installed it, etc.

However when I launch the move_group.launch (or the demo.launch as well) I receive this exception:

...: Loading robot model 'Robot_Arm.SLDASM'...
terminate called after throwing an instance of 'ros::InvalidNameException'
what(): Character [-] at element [45] is not valid in Graph Resource Name [/robot_description_planning/joint_limits/Base-Servo2/max_position]. Valid characters are a-z, A-Z, 0-9, / and _.

and then it detects the process has died and I get dumped out.

If I launch the demo.launch, Rviz does load but I get no model shown, and it has an error about NO PLANNING LIBRARY LOADED and there is nothing to select in the dropdown. I have a feeling this may all be related.

This error seems to be because I have set my limits as -x to y radians for my servos. This is necessary I think.

Why doesn't it like negative radian values for limits? And what is the best way to fix this?

I have thought about redesigning my URDF to make servo limits between 0 and 3.1 radians, if it is possible to do this.

<robot
  name="Robot_Arm.SLDASM">
  <link
    name="base_link">
    <inertial>
      <origin
        xyz="0.00071683 0.020356 0.0337"
        rpy="0 0 0" />
      <mass
        value="0" />
      <inertia
        ixx="0"
        ixy="0"
        ixz="0"
        iyy="0"
        iyz="0"
        izz="0" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://robot_arm2/meshes/base_link.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.75294 0.75294 0.75294 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://robot_arm2/meshes/base_link.STL" />
      </geometry>
    </collision>
  </link>
  <link
    name="Servo2">
    <inertial>
      <origin
        xyz="0.0022691 0.018959 -0.0094813"
        rpy="0 0 0" />
      <mass
        value="0" />
      <inertia
        ixx="0"
        ixy="0"
        ixz="0"
        iyy="0"
        iyz="0"
        izz="0" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://robot_arm2/meshes/Servo2.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.75294 0.75294 0.75294 1" />
      </material>
    </visual>
    <collision>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://robot_arm2/meshes/Servo2.STL" />
      </geometry>
    </collision>
  </link>
  <joint
    name="Base-Servo2"
    type="revolute">
    <origin
      xyz="0.00012 0.0001411 0.0744"
      rpy="1.5708 0 0" />
    <parent
      link="base_link" />
    <child
      link="Servo2" />
    <axis
      xyz="0 -1 0" />
    <limit
      lower="-1.5"
      upper="1.5"
      effort="0"
      velocity="0" />
  </joint>
  <link
    name="Upper_Arm">
    <inertial>
      <origin
        xyz="-0.0013475 0.053 9.5019E-16"
        rpy="0 0 0" />
      <mass
        value="0" />
      <inertia
        ixx="0"
        ixy="0"
        ixz="0"
        iyy="1.1301E-05"
        iyz="0"
        izz="0" />
    </inertial>
    <visual>
      <origin
        xyz="0 0 0"
        rpy="0 0 0" />
      <geometry>
        <mesh
          filename="package://robot_arm2/meshes/Upper_Arm.STL" />
      </geometry>
      <material
        name="">
        <color
          rgba="0.75294 0 ...
(more)
edit retag flag offensive close merge delete

Comments

Unless there is an easier way, I think the fastest way to resolve this is to reconstruct my solidworks model so all servos are in the 0 position to begin with, rather than the home position

Then, the home position can be created as a pose later on.

karlhm76 gravatar image karlhm76  ( 2016-07-04 09:11:16 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-07-04 09:26:04 -0500

gvdhoorn gravatar image

updated 2016-07-04 09:41:09 -0500

Why doesn't it like negative radian values for limits? And what is the best way to fix this?

I don't think this has anything to do with specifying negative limits for your joints, that is perfectly well supported (would be very strange if it weren't).

As the error tells you, a name containing a - is not allowed. Looking at your urdf, I see joint names like Base-Servo2. MoveIt uses the names of the joints as part of parameter names, and those cannot contain dashes. You can see the offending parameter name in the error message:

robot_description_planning/joint_limits/Base-Servo2/max_position

I think if you change the joint names, things will start to work.

You can find more about what are considered valid names in ROS on wiki/Names.

PS: besides the illegal dash, I'd also recommend you don't use capitals anywhere: not in names of xacro/urdf entities (ie: joints, links), but also not in filenames or extensions. Rationale: if there are never any capitals, you cannot by mistake use the wrong capitalisation anywhere. Seeing as Linux FS are case-sensitive, that is a good thing.


Edit:

reconstruct my solidworks model so all servos are in the 0 position to begin with, rather than the home position. Then, the home position can be created as a pose later on.

If I may suggest, I would do this in any case. By convention, ROS urdfs are modelled with the robot in its zero position, which isn't necessarily its home position. Zero poses for robots typically don't change (as that would mean changing the positions of encoders on joints), home positions do. By coupling the urdf to your home position, you'd have to update the urdf whenever the home position changes.

edit flag offensive delete link more

Comments

Thanks I'll give it a try, i don't want to redo the whole model.

Looking closely i can see now that position 45 in that string is the - in the name. I was thinking it was the value it was referring to.

Cheers!

karlhm76 gravatar image karlhm76  ( 2016-07-04 16:32:33 -0500 )edit

i don't want to redo the whole model.

well, that is up to you of course. There are some bits in ROS that will assume your urdf is modelled with the robot at its zero position though (like the joint_state_publisher fi).

gvdhoorn gravatar image gvdhoorn  ( 2016-07-05 01:27:59 -0500 )edit

Renamed the joints and success! Thanks for all the help.

karlhm76 gravatar image karlhm76  ( 2016-07-06 02:41:48 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-07-04 07:43:32 -0500

Seen: 639 times

Last updated: Jul 06 '16