-
Notifications
You must be signed in to change notification settings - Fork 65
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
Full robot state while moving #44
base: master
Are you sure you want to change the base?
Conversation
Hi @Toni-SM i pulled your version of the frankx, with the changes, since the capability to access the robot state is while on motion something very interesting for my application. After the pull, i compile the code and installed the frankx library using the
Is this something you have seen before and if soo can you please tell me what im doing wrong? A big thanks in advance. Miguel Tavares. |
Make sure you are compiling the robot-state branch and not the
By the way, are you able to use the compiled files provided above? |
Hi, @Toni-SM I am running the robot-state branch. I can run the code now but the exception raised in the try continues to give me an error saying that ```
|
Are you importing frankx? import frankx And, the compiled files provided above are just a compilation of the branch... |
Hi @Toni-SM, I was missing the import, but now it's working. Can you give an explanation of what you did in order for this to work? |
This pull request just stores the current RobotState on each motion update and modifies the API to return the RobotState when the original methods are called with the Since this update is only performed when the robot is in motion, it is necessary to invoke the API as follows to ensure that the state of the robot is obtained when it is stopped. Otherwise, when it is stopped (and # Get the current state handling the read exception when the robot is in motion
try:
robot_state = robot.get_state(read_once=True)
except frankx.InvalidOperationException:
robot_state = robot.get_state(read_once=False) |
Hi, Thanks for creating this feature. The links of the submodules don't work. Could you please fix the submodules? So I tried to git clone the original frankx and added your modification manually. But, the frankx library used remains the original one and for some reason, pybind does not seem to work. The c++ function get_state(read_once) is well created, but not the python one. Do you know potentially what is going wrong? |
Any progress on this merge? |
This pull request allows getting the robot state (for all motion types) when the robot is already in motion. It is a solution for the issue #32
The modified API is fully compatible with the current original version since it only adds one optional parameter (set by default to the behavior of the original API) to the existing methods. In addition, it exposes the
current_joint_positions
method and theInvalidOperationException
exception.API call
The following snippet shows the recommended way to call the API (See Robot State section in README for more details)
Compiled files
The following are the compiled files, for different versions of Python, to support the use of the proposed modification without the need to compile the library. Make sure the files are available in the active Python environment. Set the
LD_LIBRARY_PATH
to the folder that contains those files if you are experiencing theImportError: libmovex.so: cannot open shared object file: No such file or directory
exception, for example (export LD_LIBRARY_PATH=/home/user/frankx-lib
)Example
Visit the skrl (reinforcement learning library) documentation skrl - Real-world examples to see an example of application of the proposed modification applied to reinforcement learning, where it is necessary to read the state of the robot in motion to build the observation or compute the reward
reaching_franka.mp4