Robotics StackExchange | Archived questions

Graphics graphic switch direction when crosssing 0

I am trying to build a real time visualizer for my robot. I am using rviz to do this. When I move the robot the simulation model moves the same way. However, when I spin the robot through 0, it takes the "long way" to get there. it ends up in the right spot but it has to switch directions to do this. is there a way to make it do it does not switch directions but move thought the 0 point?

Here is my URDF file:

<?xml version="1.0"?>
<robot name="videoray">

  <link name="body">
    <inertial>
      <mass value="1"/>
      <inertia ixx="100" ixy="0" ixz="0" iyy="100" iyz="0" izz="100" />
      <origin/>
    </inertial>
    <visual>
      <origin rpy="0.0 0 0" xyz="0 0 0"/>
      <geometry>
         <mesh filename="file:///home/nathaniel/simulation/src/ros-videoray-sim/move_videoray/graphics/videoray_robot.stl"/> 
      </geometry>
    </visual>
  </link>

  <joint name="sonar_joint" type="fixed">
    <parent link="body" />
    <child link="sonar_link" />
  </joint>


  <link name="sonar_link">
    <inertial>
      <mass value="0.001" />
      <origin xyz="0 0 0" />
      <inertia ixx="0.0001" ixy="0.0" ixz="0.0"
               iyy="0.0001" iyz="0.0" izz="0.0001" />
    </inertial>
  </link>
</robot>

and how I am publishing the node:

current.orientation.x = kalman_pos[5]
current.orientation.y = kalman_pos[4]*-1
current.orientation.z = kalman_pos[6]*-1
current.orientation.w = kalman_pos[7]

broadcaster.sendTransform( (current.position.x,current.position.y,current.position.z), 
                            (current.orientation.x,current.orientation.y,current.orientation.z,
                            current.orientation.w),
                            rospy.Time.now(), "body", "odom" )

Asked by ngoldfarb on 2015-07-21 08:56:59 UTC

Comments

It would probably help to know a bit more about "your robot": what kind of robot is this (mobile base, serial manipulator (arm))? How did you model it in your URDF (continuous joints, or revolute), etc.

Asked by gvdhoorn on 2015-07-21 09:30:40 UTC

I updated my question to include the code.

Asked by ngoldfarb on 2015-07-21 12:16:38 UTC

Answers