0
$\begingroup$

Gazebo Answers logo

I'm a bit confused about how to get joint states.

I'm trying to set up an inverted pendulum on a two-wheeled cart. I've successfully attached differential drive, and also control of the revolute joint for the pendulum rod.

But, now I want to remove any actuators and simply access the state of the passive model. E.g., I want to view the angle of the rod as it collapses under gravity from vertical to about horizontal.

Do I nevertheless need a joint_state_controller, or even position controllers? I'm simulating in gazebo, of course.

The joint_states I see published are empty.
---
header:
seq: 105994
stamp:
secs: 2120
nsecs: 302000000
frame_id: ''
name: []
position: []
velocity: []
effort: []
---

Here are links to the relevant files as they stand now...

URDF: http://pastebin.com/MTkTgZmH

YAML: http://pastebin.com/eD0jK7AZ

Launch: http://pastebin.com/Zwrrb

Screenshot in Gazebo


My setup...
ROS Indigo, Gazebo 2.2.6.
Linux Mint 17.3 (Rosa) 64-bit.
(3.19.0-32-generic #37~14.04.1-Ubuntu SMP Thu Oct 22 09:41:40 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux)

I'd love to get angular position and velocity for the three joints (turret_to_rod, motor_to_wheelleft, motor_to_wheellright).

Thanks!


Originally posted by klaatu on Gazebo Answers with karma: 13 on 2016-07-05

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

You can add a plugin in your robot description file:

<!--Publish joint state from Gazebo-->
        <plugin name="joint_state_publisher" filename="libgazebo_ros_joint_state_publisher.so">
            <robotNamespace>your_robot_name</robotNamespace>
            <jointName>
                turret_to_rod, motor_to_wheelleft, motor_to_wheellright
            </jointName>
            <updateRate>100</updateRate>
            <alwaysOn>true</alwaysOn>
        </plugin>

Originally posted by Brosseau.F with karma: 284 on 2016-07-06

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by klaatu on 2016-07-06:
OK, thanks, that worked after I removed controller references in my my launch file. (Actually I now recall I had tried that before, but was disappointed to find no velocity data -- nor effort data.)



name: ['turret_to_rod', 'motor_to_wheelleft', 'motor_to_wheelright']
position: [-1.6200029645491254, 0.9563870177604148, 0.9066213357244619]
velocity: []
effort: []


I guess velocity and effort are not implemented?

Comment by yossi.ovcharik on 2018-01-13:
Still no implementation in Kinetic on 16.04 or am I doing something wrong?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.