Controlling the same joint with two different controller types

asked 2020-11-19 17:12:39 -0500

PGTKing gravatar image

I want to move a joint with force so I am using a JointEffortController but want to return the radian position of the joint. This is my yaml file rrbot:

Publish all joint states -----------------------------------

joint_state_controller:

type: joint_state_controller/JointStateController

publish_rate: 50

# Position Controllers ---------------------------------------

joint1_effort_controller:

type: effort_controllers/JointEffortController

joint: joint1

pid: {p: 1, i: 0.001, d: 0.065}

joint2_effort_controller:

type: effort_controllers/JointEffortController

joint: joint2

pid: {p: 1, i: 0.001, d: 0.065}

joint1_position_controller:

type: effort_controllers/JointPositionController

joint: joint1

pid: {p: 100.0, i: 0.01, d: 10.0}

joint2_position_controller:

type: effort_controllers/JointPositionController

joint: joint2

pid: {p: 100.0, i: 0.01, d: 10.0}

When I type rostopic list into the terminal it only returns JointPositionController How can I return the JointEffortController aswell?

edit retag flag offensive close merge delete

Comments

[I] want to return the radian position of the joint

joint state is published by the joint_state_controller/JointStateController, which you already have in your configuration.

When I type rostopic list into the terminal it only returns JointPositionController How can I return the JointEffortController aswell?

It's not clear to me what you are asking. rostopic list shows the currently active topics. It doesn't know anything about controllers.

Could you clarify?

gvdhoorn gravatar image gvdhoorn  ( 2020-11-20 02:54:46 -0500 )edit

@gvdhoorn this is my rostopic list / clock

/gazebo/link_states

/gazebo/model_states

/gazebo/parameter_descriptions

/gazebo/parameter_updates

/gazebo/set_link_state

/gazebo/set_model_state

/rosout

/rosout_agg

/rrbot/camera1/image_raw/compressed

/rrbot/camera1/image_raw/compressed/parameter_descriptions

/rrbot/camera1/image_raw/compressed/parameter_updates

/rrbot/camera1/image_raw/compressedDepth

/rrbot/camera1/image_raw/compressedDepth/parameter_descriptions

/rrbot/camera1/image_raw/compressedDepth/parameter_updates

/rrbot/camera1/image_raw/theora

/rrbot/camera1/image_raw/theora/parameter_descriptions

/rrbot/camera1/image_raw/theora/parameter_updates

/rrbot/camera1/parameter_descriptions

/rrbot/camera1/parameter_updates

/rrbot/joint1_position_controller/command

/rrbot/joint2_position_controller/command /rrbot/joint_states /rrbot/laser/scan /tf /tf_static

I am able to give torque commands to the joint but also want the position in radians after I give the torque com

PGTKing gravatar image PGTKing  ( 2020-11-23 13:40:13 -0500 )edit

I don't understand your comment.

You already have the joint state controller in your controller configuration.

What is it you're missing?

gvdhoorn gravatar image gvdhoorn  ( 2020-11-23 15:06:35 -0500 )edit

@gvdhoorn I have a python script and I would like to publish the joint state to the terminal, how can I do this. I tried rospy.Publisher('/rrbot/joint_state_controller/JointStateController', Float64, queue_size=10) but its not publishing.

PGTKing gravatar image PGTKing  ( 2020-11-23 15:45:48 -0500 )edit

No, that's not how this works I believe.

Perhaps there is some confusion about what the joint_state_controller actually does. See #q303358.

If you have it loaded, you should already have "the position in radians".

gvdhoorn gravatar image gvdhoorn  ( 2020-11-24 02:16:05 -0500 )edit