Home | Tutorials | Wiki | Issues
Ask Your Question
0

why my wheel joint is spin,when I use Joint::setposition to control it?

asked 2018-10-25 00:29:50 -0600

xianxjm gravatar image

updated 2018-10-26 06:37:07 -0600

How to use Joint::setposition to control a joint? Is there a doc or example? I know how to control joint by SetPositionPID,but this method is not very good performance, the wheel movement is not very accurate.

Thanks advance!

code like this :

void TestS::Update(const common::UpdateInfo &iInfo){

        m_ptrModel->GetJoint("left_wheel_joint")->SetForce(0,3800);
        m_ptrModel->GetJoint("left_wheel_joint")->GetChild()->SetEnabled(true);
        m_ptrModel->GetJoint("left_wheel_joint")->GetParent()->SetEnabled(true);

        m_ptrModel->GetJoint("right_wheel_joint")->SetForce(0,3800);
        m_ptrModel->GetJoint("right_wheel_joint")->GetChild()->SetEnabled(true);
        m_ptrModel->GetJoint("right_wheel_joint")->GetParent()->SetEnabled(true);
        m_ptrModel->GetJoint("left_wheel_joint")->SetPosition(0,update);
        m_ptrModel->GetJoint("right_wheel_joint")->SetPosition(0,update);
       update++;

}

edit retag flag offensive close merge delete

Comments

1

can you post relevant parts of your code? Namely transmission tags and controller configuration files.

kumpakri gravatar imagekumpakri ( 2018-10-25 06:28:06 -0600 )edit

@kumpakri I post my code , please help~ if you have anothor way to control the precise movement of the wheels,Thanks for sharing!

xianxjm gravatar imagexianxjm ( 2018-10-26 06:40:38 -0600 )edit

1 Answer

Sort by » oldest newest most voted
1

answered 2018-11-02 08:32:09 -0600

wentz gravatar image

Because you are also setting a force to the joints causing them to rotate.

edit flag offensive delete link more

Comments

Have you ever tried? Without setting a force to the joints,the situation is worse!!!

xianxjm gravatar imagexianxjm ( 2018-11-23 04:20:03 -0600 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-10-25 00:29:50 -0600

Seen: 303 times

Last updated: Nov 02