Home | Tutorials | Wiki | Issues
Ask Your Question
1

How can I control Joint with multi-axis

asked 2016-08-23 00:21:44 -0500

MIBE gravatar image

Hello, I'm creating a simple robot model like pan-tilt camera.

To simulate it, I added 3 links and 2 joints ( revolute ) because I couldn't specify the axis with SetPositionPID() and SetPositionTarget() functions.

But what I really want is to add only 2 links and 1 joint using "revolute2" and control each axes with different PID controllers. Only function what I found was SetJointPosition(), SetJointVelocity() but I couldn't give separated PID controllers to each axes and I'm not sure what kind of controller is controlling the joint in those functions.

How do you control the joint with multi-axes?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-08-24 01:39:49 -0500

MIBE gravatar image

Maybe I just found a solution but I didn't test it with revolute2 joint yet.

The solution is to use message named joint_cmd.

As you can see below, I could specify the axis of joint with set_axis() method in msgs::JointCmd class.

           msgs::JointCmd stMsgJointCmd;
    msgs::PID stMsgPID;

    std::string strWheelName = "robot::lwheel_joint";
    stMsgJointCmd.set_axis(0);
    stMsgJointCmd.set_allocated_name(&strWheelName);
    stMsgPID.set_target(100.0);
    stMsgJointCmd.set_allocated_velocity(&stMsgPID);
    m_poJointCmdPub->Publish(stMsgJointCmd);
    stMsgJointCmd.release_name();
    stMsgJointCmd.release_velocity();

I think PID controller for each axes could be specified too, but couldn't confirm it.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-08-23 00:21:44 -0500

Seen: 209 times

Last updated: Aug 24 '16