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

I made a 6-DOF arm using xacro , its moving in gazebo but when i use tf_echo , the orientation and position of a frame does not change overtime.

asked 2020-05-04 09:50:02 -0500

saztyga gravatar image

updated 2020-05-04 12:40:40 -0500

when arm moves in gazebo the orientation and position of a frame in a link should change over time.

but when i use rosrun tf tf_echo [frame1] [frame2] the position and orientation remain unchanged.

please help me out with this.

my model moves in gazebo but not in rviz..

thanks in advance

Here is my launch file

<?xml version="1.0"?>
<launch>
<group ns="/arm">
<param name="robot_description" command="$(find xacro)/xacro $(find robo_arm)/urdf/robo_dis.xacro"/>
    <arg name="x" default="0"/>
    <arg name="y" default="0"/>
    <arg name="z" default="0.5"/>

      <node name="mybot" pkg="gazebo_ros" type="spawn_model" output="screen"
          args="-urdf -param robot_description -model arm -x $(arg x) -y $(arg y) -z $(arg z)" />
     <rosparam command="load" file="$(find robo_arm)/config/joints.yaml" />
     <node name="controller_spawner" pkg="controller_manager" type="spawner"
            respawn="false" output="screen" ns="/arm"
            args="--namespace=/arm
            joint_state_controller
            joint1_position_controller
            joint2_position_controller
            joint3_position_controller
            joint4_position_controller
            --timeout 60">
     </node>
   <node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
  </node>
  <!-- Combine joint values -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

</group>

Topic List

/arm/joint1_position_controller/command
/arm/joint1_position_controller/pid/parameter_descriptions
/arm/joint1_position_controller/pid/parameter_updates
/arm/joint1_position_controller/state
/arm/joint2_position_controller/command
/arm/joint2_position_controller/pid/parameter_descriptions
/arm/joint2_position_controller/pid/parameter_updates
/arm/joint2_position_controller/state
/arm/joint3_position_controller/command
/arm/joint3_position_controller/pid/parameter_descriptions
/arm/joint3_position_controller/pid/parameter_updates
/arm/joint3_position_controller/state
/arm/joint4_position_controller/command
/arm/joint4_position_controller/pid/parameter_descriptions
/arm/joint4_position_controller/pid/parameter_updates
/arm/joint4_position_controller/state
/arm/joint_states 
/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/rosout
/rosout_agg 
/tf
/tf_static
edit retag flag offensive close merge delete

Comments

1

Does your model have a joint_state_controller to publish joint states to ROS? Have you loaded the corresponding URDF to the parameter server and setup the robot_state_publisher to publish the tf data associated with the joint states? These are all steps that are usually followed to have a moving Gazebo model be reflected in the ROS tf tree. Without more information about your particular setup, it will be very challenging to provide much help on this question.

jarvisschultz gravatar image jarvisschultz  ( 2020-05-04 10:30:35 -0500 )edit

The Gazebo ros_control tutorial has a good explanation and example of how these pieces are supposed to fit together.

jarvisschultz gravatar image jarvisschultz  ( 2020-05-04 10:31:27 -0500 )edit

sir, Please check my topic list and launch file...each link broadcasting tf data but when i move the joints by publising messages, tf data remains unchanges..its should changed.

saztyga gravatar image saztyga  ( 2020-05-04 12:31:57 -0500 )edit

Thanks a lot Sir, by removing node joint_state_publisher i am able to get desired results. thanks a lot

saztyga gravatar image saztyga  ( 2020-05-04 12:57:05 -0500 )edit

Excellent! I converted my comment to an answer since that turned out to be a correct guess.

jarvisschultz gravatar image jarvisschultz  ( 2020-05-04 14:48:39 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-05-04 12:43:59 -0500

Just glancing at your launch files, my guess is that both the joint_state_publisher and gazebo are publishing on the /arm/joint_states topic. I'd look at rostopic info /arm/joint_states and rosnode info /arm/robot_state_publisher. Ideally, only gazebo would publish joint state information, and the robot_state_publisher would be subscribed to that topic.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2020-05-04 09:50:02 -0500

Seen: 135 times

Last updated: May 04 '20