Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

How do I control a joint via the API?

$
0
0
I have a robot with a single revolute joint attaching a horizontal arm to a box. I want to control this arm from a client program, but I cannot for the life of me understand how to tell the joint to move. When I connect to Gazebo, my client program gets a series of available topics, one of which is my joint: [snip] 192.168.0.14:33324 /gazebo/default/user_cmd gazebo.msgs.UserCmd 192.168.0.14:33324 /gazebo/default/playback_control gazebo.msgs.LogPlaybackControl 192.168.0.14:33324 /gazebo/default/log/control gazebo.msgs.LogControl 192.168.0.14:33324 /gazebo/default/world_control gazebo.msgs.WorldControl 192.168.0.14:33324 /gazebo/server/control gazebo.msgs.ServerControl 192.168.0.14:33324 /gazebo/default/Sickle/joint_cmd gazebo.msgs.JointCmd 192.168.0.14:33324 /gazebo/default/Sickle::link_2_JOINT_4/joint_cmd gazebo.msgs.JointCmd I assumed that what I needed to do was to somehow publish `JointCmd` messages on that topic, so my client advertises this by sending a `Publish` message to Gazebo: advert := &msg.Publish{ Topic: proto.String("/gazebo/default/Sickle::link_2_JOINT_4/joint_cmd"), MsgType: proto.String("gazebo.msgs.JointCmd"), Host: proto.String("127.0.0.1"), Port: proto.Uint32(uint32(port)), } But I never get a connection back, unless I manually open the "Topic Visualization" and connect from inside Gazebo. Are there any code examples anywhere, in any language, for how to remotely control a robot in Gazebo?

Viewing all articles
Browse latest Browse all 7017

Trending Articles