Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch joint configuration in CMC thread #161

Closed
PeterBowman opened this issue Jul 19, 2018 · 11 comments
Closed

Watch joint configuration in CMC thread #161

PeterBowman opened this issue Jul 19, 2018 · 11 comments
Assignees

Comments

@PeterBowman
Copy link
Member

PeterBowman commented Jul 19, 2018

Expanding on #159, status checks could be performed on each thread step to make sure that no joints are out of limits, nor maximum permisible speeds/accelerations are exceeded. I'd put them before the actual handler (e.g. handleMovl) is entered:

void roboticslab::BasicCartesianControl::run()
{
switch (getCurrentState())
{
case VOCAB_CC_MOVJ_CONTROLLING:
handleMovj();
break;
case VOCAB_CC_MOVL_CONTROLLING:
handleMovl();
break;
case VOCAB_CC_MOVV_CONTROLLING:
handleMovv();
break;
case VOCAB_CC_GCMP_CONTROLLING:
handleGcmp();
break;
case VOCAB_CC_FORC_CONTROLLING:
handleForc();
break;
default:
break;
}
}

Motivation: starting from point A, I can issue a movl command to reach point B, but joint limits are hit at some point. The controller should either stop and throw an error, or at least warn the user. Now, it just goes on and the final trajectory might be kinda curvy with no warn (sometimes even not noticeable at all, or we notice it too late so that it cannot be stopped nor further corrections be made).

Partially (regarding speeds and accelerations) blocked by roboticslab-uc3m/yarp-devices#189.

Edit: see #161 (comment).

@PeterBowman
Copy link
Member Author

Marking as high priority per #164.

@PeterBowman
Copy link
Member Author

@rsantos88
Copy link
Contributor

Motivation: starting from point A, I can issue a movl command to reach point B, but joint limits are hit at some point. The controller should either stop and throw an error, or at least warn the user. Now, it just goes on and the final trajectory might be kinda curvy with no warn (sometimes even not noticeable at all, or we notice it too late in order to stop and make corrections)

This is caused because if the joint reachs its limit, it stops and doesn't continue but the rest of joints that have not reached their limit continue their movement, producing a deviation of the trajectory. We need to stop the movement of all kinematic chain when a joint reaches its limit (In reference to roboticslab-uc3m/teo-bimanipulation#3 )

@PeterBowman PeterBowman self-assigned this Oct 9, 2018
@PeterBowman
Copy link
Member Author

I've committed ba17795, but this is a naive approach. It won't work on simulation since I'm checking against the limits fetched from the simulator itself, that is, the remote_controlboard client within BCC should never be reported a joint value out of the expected range. It will just stop moving the offending joint and go on with the controlled trajectory, regardless of what we do from the BCC side. On the real robot, limits are parsed from the .ini files. It really depends on how are they handled by the motor driver (Technosoft iPOS), but we can potentially incur in a similar issue.

A solution I can come up with for this is to apply a small epsilon that would make the joint limit check report an out-of-range value a bit earlier that it's actually supposed to.

@PeterBowman
Copy link
Member Author

PeterBowman commented Oct 9, 2018

A solution I can come up with for this is to apply a small epsilon that would make the joint limit check report an out-of-range value a bit earlier that it's actually supposed to.

Here it is: 6544a92. The problem is that I couldn't perform any CMC motion from the simulated AMOR's initial pose with epsilon = 0.001 since it starts very closely to the configured limit on certain joints. It did work after decreasing to 0.00001, though. @jgvictores do you think this is a robust solution?

@jgvictores
Copy link
Member

A small epsilon that would make the joint limit check report an out-of-range value a bit earlier that it's actually supposed to.

@jgvictores do you think this is a robust solution?

I guess it all boils down to roboticslab-uc3m/teo-main#15 and should end up somewhere in https://github.com/roboticslab-uc3m/developer-manual but sure! If it works, go for it!!

@PeterBowman
Copy link
Member Author

OK, done at d2afc5e. I'm therefore removing the priority: high label as there is more to be done here and the urgency has been removed.

A word of caution: once having reached a limit, the cartesian controller will not be able to move the joint out of it. Instead, connect to the RPC port and change the robot position via set pos x ....

@PeterBowman
Copy link
Member Author

PeterBowman commented Mar 8, 2019

A word of caution: once having reached a limit, the cartesian controller will not be able to move the joint out of it. Instead, connect to the RPC port and change the robot position via set pos x ....

There should be a way to regain control of the robot once joint limits are hit.

@PeterBowman
Copy link
Member Author

There should be a way to regain control of the robot once joint limits are hit.

Done at 406ea26.

@PeterBowman PeterBowman changed the title Watch joint configuration and instantaneous speeds/accelerations in CMC thread Watch joint configuration in CMC thread May 16, 2019
@PeterBowman
Copy link
Member Author

  • Joint limits done (see referenced commits in the previous comments).
  • Speed/acceleration checks: not doing, retitled accordingly. These parameters (actually, only the velocities) are obtained from internal solver calculations and ultimately originate from user commands (in cartesian space). For that reason, I don't think we should query the robot for its current instantaneous velocity (this is indeed blocked by Implement instantaneous speed/acceleration getters yarp-devices#189). Rather than that, let's fetch robot velocity limits and check commanded joint velocities against them before sending anything to the robot. This approach has been followed in 84739d0.

@PeterBowman
Copy link
Member Author

(actually, only the velocities)

Probably, I also considered accelerations having https://github.com/roboticslab-uc3m/kinematics-dynamics/issues/163 in mind. Although this is not the common use case, it merits its own case study and further analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants