Joint angles in Myorobotics Arm


#1

Hello,

I am also rather new to the NRP and try to implement a neural network on the already available Myoarm template (2 DOF NST Myorobotics Arm for WP4 Cerebellum Experiment).

Is there already a way to read out the joint_states in this scenario, because it seems like there is no publisher for this topic and thus the read out value returns “None”.

I would greatly appreciate any help. :slight_smile:


#2

Hi,

Indeed the /joint_states is not advertised by this model.
Still, you can query some information via ROS in the following way:

rosservice call /gazebo/get_joint_properties RadiusBone
type: 0
damping: []
position: [0.7003605898697565]
rate: [-0.0335289867111977]
success: True
status_message: "GetJointProperties: got properties"

Best regards,
Luc


#3

Hey,

that helped. Thank you very much.

However, I need to access the joint angles from inside the transfer function on the NRP. After a lot of trying out I did actually eventually found this post to be helpful:
How to control my own robot through transfer function

I added the generic controller plugin to the .sdf file and that did the trick:

<plugin name='generic_controller' filename='libgeneric_controller_plugin.so'>
    <controller joint_name='humerus_radius'>
        <type>position</type>
        <pid>150.0 10.0 50.0</pid>
    </controller>
</plugin> 

After that I was able to read out the data in the transfer function with

joint_states_msg.value.position[1]

So maybe that helps others, too.

Thnak you again,
Annika