Robotics StackExchange | Archived questions

How can I control Joint with multi-axis

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?

Asked by MIBE on 2016-08-23 00:21:44 UTC

Comments

Answers

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.

Asked by MIBE on 2016-08-24 01:39:49 UTC

Comments