-
Notifications
You must be signed in to change notification settings - Fork 27
Fix environment reset for full-body mode #38
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Author
|
Hi @xuai05, thanks for trying out this branch! Could you share the code you're using to launch BiGym in full-body mode? Here's a working code sample for this branch: Expected output: Could you try running this and let me know if it doesn't work? |
|
Hi Cherniadev,
Thank you so much for your prompt response and for providing the working code sample.
I have successfully obtained the expected results as you demonstrated.
However, while visualizing the environment, I encountered an issue where the rendered image appears as follows:
I am unsure whether this is due to a potential camera angle configuration in the current code or if it is related to the execution of my script.
frombigym.action_modesimportJointPositionActionMode
frombigym.bigym_envimportBiGymEnv
fromPILimportImage
env_class=BiGymEnv
action_mode_class=JointPositionActionMode
env=env_class( action_mode=action_mode_class(floating_base=False), render_mode="rgb_array" )
img=env.render()
print(f"img {type(img)}, shape is {img.shape}")
obs, _=env.reset()
foriinrange(50):
obs, rew, term, trunc, info=env.step(env.action_space.sample())
print(f"obs typs{type(obs)}")
img=env.render()
image=Image.fromarray(img)
image.save(f"output_image_{i}.png")
env.close()
I would really appreciate your insights on this and look forward to your guidance on resolving the issue.
…-----原始邮件-----
发件人:"Nikita Cherniadev" ***@***.***>
发送时间:2025-03-16 17:08:39 (星期日)
收件人: chernyadev/bigym ***@***.***>
抄送: xuai05 ***@***.***>, Mention ***@***.***>
主题: Re: [chernyadev/bigym] Fix environment reset for full-body mode (PR #38)
Hi @xuai05, thanks for trying out this branch! Could you share the code you're using to launch BiGym in full-body mode?
Here's a working code sample for this branch:
from bigym.action_modes import JointPositionActionMode
from bigym.envs.reach_target import ReachTarget
env = ReachTarget(
action_mode=JointPositionActionMode(floating_base=False),
render_mode="human",
)
print("Observation Space:")
print(env.observation_space)
print("Action Space:")
print(env.action_space)
env.reset()
for i in range(1000):
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
img = env.render()
if i % 100 == 0:
env.reset()
env.close()
Expected output:
Observation Space:
Dict('proprioception': Box(-inf, inf, (74,), float32), 'proprioception_grippers': Box(0.0, 1.0, (2,), float32))
Action Space:
Box([-0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1
-0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 0. 0. ], [0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1
0.1 0.1 0.1 1. 1. ], (23,), float32)
Could you try running this and let me know if it doesn't work?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
chernyadev left a comment (NeuracoreAI/bigym#38)
Hi @xuai05, thanks for trying out this branch! Could you share the code you're using to launch BiGym in full-body mode?
Here's a working code sample for this branch:
from bigym.action_modes import JointPositionActionMode
from bigym.envs.reach_target import ReachTarget
env = ReachTarget(
action_mode=JointPositionActionMode(floating_base=False),
render_mode="human",
)
print("Observation Space:")
print(env.observation_space)
print("Action Space:")
print(env.action_space)
env.reset()
for i in range(1000):
obs, reward, terminated, truncated, info = env.step(env.action_space.sample())
img = env.render()
if i % 100 == 0:
env.reset()
env.close()
Expected output:
Observation Space:
Dict('proprioception': Box(-inf, inf, (74,), float32), 'proprioception_grippers': Box(0.0, 1.0, (2,), float32))
Action Space:
Box([-0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1
-0.1 -0.1 -0.1 -0.1 -0.1 -0.1 -0.1 0. 0. ], [0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1
0.1 0.1 0.1 1. 1. ], (23,), float32)
Could you try running this and let me know if it doesn't work?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Collaborator
Author
|
@xuai05 Could you please validate the code you're using? We can't reproduce this behavior on this branch. Let me know if the issue still occurs. Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Closes #37 🕺