Home | Tutorials | Wiki | Issues
Ask Your Question
0

Getting joint angles for passive urdf model

asked 2016-07-05 15:18:20 -0500

klaatu gravatar image

updated 2016-07-05 18:32:56 -0500

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!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-07-06 01:55:50 -0500

Brosseau.F gravatar image

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>
edit flag offensive delete link more

Comments

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?

klaatu gravatar imageklaatu ( 2016-07-06 10:31:38 -0500 )edit

Still no implementation in Kinetic on 16.04 or am I doing something wrong?

yossi.ovcharik gravatar imageyossi.ovcharik ( 2018-01-13 09:44:27 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-07-05 15:18:20 -0500

Seen: 1,535 times

Last updated: Jul 06 '16