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

Get state while moving #32

Open
guenhael opened this issue Jan 10, 2022 · 6 comments
Open

Get state while moving #32

guenhael opened this issue Jan 10, 2022 · 6 comments

Comments

@guenhael
Copy link

Hello,

Is there any way to get information like the pose or the "active waypoint" while the robot is moving? It would be very useful.

I tried to do it with Robot.move_async and then Robot.read_once() but it's not permitted.

Thank you for your help.

@yuchen93
Copy link

Following this! I'd like to be able to record robot poses while it is moving.

@Toni-SM
Copy link

Toni-SM commented Jul 26, 2022

Hi, Following this too!

@guenhael
Copy link
Author

guenhael commented Jul 29, 2022

Hello,

For your information, a solution has been programmed and can be found here : https://github.com/guenhael/frankx/tree/get_O_T_EE_while_moving

A pull request has been done to add this update to the official frankx library.

If you have any suggestion of improvement, let me know.

@Toni-SM
Copy link

Toni-SM commented Sep 19, 2022

Hi,

A solution for getting the robot state while moving, for all supported motions types can be found in the pull request #44

With this modification it is possible to get the state of the robot (stopped or in motion) by calling the original API as follow

robot = Robot("172.16.0.2")

# Get the current state handling the read exception when the robot is in motion
try:
    robot_state = robot.get_state()
except frankx.InvalidOperationException:
    robot_state = robot.get_state(read_once=False)

# Get the current pose handling the read exception when the robot is in motion
try:
    pose = robot.current_pose()
except frankx.InvalidOperationException:
    pose = robot.current_pose(read_once=False)

# Get the current joint positions handling the read exception when the robot is in motion
try:
    joint_positions = robot.current_joint_positions()
except frankx.InvalidOperationException:
    joint_positions = robot.current_joint_positions(read_once=False)

It use has been tested in a reinforcement learning application as exemplified in the skrl - Real-world examples documentation

@lushihan
Copy link

Following this!

@carloLV
Copy link

carloLV commented Oct 12, 2022

I am also following this.
It would be nice to know the results of the PRs.

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

5 participants