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

Issue on the mobile base translation #470

Open
ClaireHzl opened this issue Jan 8, 2025 · 1 comment · May be fixed by #474
Open

Issue on the mobile base translation #470

ClaireHzl opened this issue Jan 8, 2025 · 1 comment · May be fixed by #474
Assignees

Comments

@ClaireHzl
Copy link
Collaborator

ClaireHzl commented Jan 8, 2025

After connecting to SDK then moving Reachy by hand (rotate by - 90° and move forward by few centimeters), then :

get_to_waiting_pose(reachy, duration=3)
reachy.mobile_base.translate_by(x= 0.2, y= 0.0)

No movement, and this error :

Cell In[4], [line 3](vscode-notebook-cell:?execution_count=4&line=3)
      [1](vscode-notebook-cell:?execution_count=4&line=1) reachy.turn_on()
      [2](vscode-notebook-cell:?execution_count=4&line=2) get_to_waiting_pose(reachy, duration=3)
----> [3](vscode-notebook-cell:?execution_count=4&line=3) reachy.mobile_base.translate_by(x= 0.2, y= 0.0)

File ~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:389, in MobileBase.translate_by(self, x, y, timeout)
    [387](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:387) x_goal = x_current + (x * np.cos(theta_rad) - y * np.sin(theta_rad))
    [388](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:388) y_goal = y_current + (x * np.sin(theta_rad) + y * np.cos(theta_rad))
--> [389](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:389) self.goto(x_goal, y_goal, theta, timeout=timeout)

File ~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:287, in MobileBase.goto(self, x, y, theta, timeout, tolerance)
    [285](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:285)     exec.submit(_wrapped_goto)
    [286](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:286) if not exc_queue.empty():
--> [287](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:287)     raise exc_queue.get()

File ~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:272, in MobileBase.goto.<locals>._wrapped_goto()
    [270](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:270) def _wrapped_goto() -> None:
    [271](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:271)     try:
--> [272](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:272)         asyncio.run(
    [273](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:273)             self._goto_async(
    [274](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:274)                 x=x,
    [275](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:275)                 y=y,
    [276](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:276)                 theta=theta,
...
    [316](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:316)     theta_goal=FloatValue(value=deg2rad(theta)),
    [317](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:317) )
    [318](https://file+.vscode-resource.vscode-cdn.net/home/claire/Dev/trailer/~/Dev/reachy2-sdk/src/reachy2_sdk/parts/mobile_base.py:318) self._mobility_stub.SendGoTo(req)

ValueError: The asbolute value of y should not be more than 1.0!
@ClaireHzl ClaireHzl self-assigned this Jan 8, 2025
@ClaireHzl
Copy link
Collaborator Author

Because the current odometry is already with a x or y value near 1, and we add a translation so it raises an error

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