joint_state_publisher not working with gazebo model !

asked 2018-05-02 00:18:22 -0500

updated 2018-05-02 01:40:37 -0500

Hey , I recently started out on robotic manipulators , I have build a URDF model of the robot and it looks fine .

https://github.com/chefbot/saya , this is the complete repository

roslaunch saya_gazebo robot_spawn.launch

Use the above to launch the gazebo model , it will spawn the gazebo model and joint_state_publisher

roslaunch saya_description saya_rviz.launch

* The published topics *

/clock
/gazebo/link_states
/gazebo/model_states
/gazebo/parameter_descriptions
/gazebo/parameter_updates
/gazebo/set_link_state
/gazebo/set_model_state
/joint_states
/rosout
/rosout_agg
/saya/camera1/camera_info
/saya/camera1/image_raw
/saya/camera1/image_raw/compressed
/saya/camera1/image_raw/compressed/parameter_descriptions
/saya/camera1/image_raw/compressed/parameter_updates
/saya/camera1/image_raw/compressedDepth
/saya/camera1/image_raw/compressedDepth/parameter_descriptions
/saya/camera1/image_raw/compressedDepth/parameter_updates
/saya/camera1/image_raw/theora
/saya/camera1/image_raw/theora/parameter_descriptions
/saya/camera1/image_raw/theora/parameter_updates
/saya/camera1/parameter_descriptions
/saya/camera1/parameter_updates
/saya/joint1_position_controller/command
/saya/joint2_position_controller/command
/saya/joint3_position_controller/command
/saya/joint4_position_controller/command
/saya/joint5_position_controller/command
/saya/joint6_position_controller/command
/saya/joint_states
/saya/laser/scan
/tf
/tf_static

* How the URDF is defined *

  <transmission name="tran1">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint1">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor1">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran2">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint2">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor2">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran3">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint3">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor3">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran4">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint4">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor4">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran5">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint5">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor5">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran6">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint6">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor6">
      <hardwareInterface>PositionJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

   <!--Transmission and actuators-->
  <transmission name="tran1">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint1">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor1">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran2">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint2">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor2">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>


  <!--Transmission and actuators-->
  <transmission name="tran3">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint3">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor3">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran4">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint4">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor4">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>



  <!--Transmission and actuators-->
  <transmission name="tran5">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint5">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor5">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <transmission name="tran6">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint6">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor6">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

* The control launch script *

<launch>
  <!--Load the joint controllers to param server-->
  <rosparam file="$(find saya_control)/config/saya_control.yaml" command="load"/>

  <!--Load controllers-->
  <node name="spawner" pkg="controller_manager" type="spawner" respawn="false"
    output ...
(more)
edit retag flag offensive close merge delete

Comments

Please don't use an image to display text. Images are not searchable and people cannot copy and paste the text from the image. Please update your question with a copy and paste of the text.

jayess gravatar image jayess  ( 2018-05-02 01:06:54 -0500 )edit

It notoriously difficult to add text/code because , everything needs to be intended (not put inside quotes )

Anyways i have added comments to what the images are refereeing to!

chrissunny94 gravatar image chrissunny94  ( 2018-05-02 01:29:02 -0500 )edit
1

It notoriously difficult to add text/code because , everything needs to be intended

copy-paste text, select it all with the mouse, press Preformatted Text button (the one with 101010 on it. Done.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-02 01:34:37 -0500 )edit

As-is, your question violates the support guidelines (especially the: "don't post screenshots of text" part). Please update it or I'll close it later today.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-02 01:36:15 -0500 )edit
1

As to your question: the joint_state_publisher is not meant to control any robots. The joint_state_controller from ros_control is not a controller, but only broadcasts joint state.

Its name is unfortunate, so I can see where the confusion comes from.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-02 01:36:58 -0500 )edit

@gvdhoorn , thanks , i have edited the question (and thank you for telling me how to !).

Well back to the problem . I can move the robotic arm vai publishing the command like this

rostopic pub /saya/joint2_position_controller/command std_msgs/Float64 "data: -0.9"
chrissunny94 gravatar image chrissunny94  ( 2018-05-02 01:45:05 -0500 )edit
1

That's great, but without some work, the output of joint_state_publisher (ie: JointState msg) will not be compatible with that. I also don't recommend using JSP for controlling robots. It's not what it is meant for.

gvdhoorn gravatar image gvdhoorn  ( 2018-05-02 01:48:17 -0500 )edit

Hey , the problem i am trying to describe is there with this package as well

https://github.com/ROBOTIS-GIT/ROBOTI...

  • when gazebo model launched , then rviz launched , it messes up the rviz model
  • cannot control the gazebo model with rqt/ joint_state_publisher
chrissunny94 gravatar image chrissunny94  ( 2018-05-02 02:31:48 -0500 )edit