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

It seems get_low_dim_data() method has bug inside #16

Closed
mch5048 opened this issue Nov 13, 2019 · 2 comments
Closed

It seems get_low_dim_data() method has bug inside #16

mch5048 opened this issue Nov 13, 2019 · 2 comments

Comments

@mch5048
Copy link

mch5048 commented Nov 13, 2019

Hi, I'm really enjoying this fascinating environment you guys have released to facilitate the RL robotics research.
While I'm implementing some algorithms that is going to be tested on your environment, I encountered an error related to get_low_dim_data() method of Observation() class.
In
low_dim_data = [] if self.gripper_open is None else [self.gripper_open] for data in [self.joint_velocities, self.joint_positions, self.joint_forces, self.gripper_pose, self.gripper_joint_positions, self.gripper_touch_forces, self.task_low_dim_state]: if data is not None: low_dim_data.extend(data) return np.concatenate(low_dim_data),

the np.concatenate does not work since the gripper_open attribute is float, while others are np.ndarray, resulting the python complaining as

return np.concatenate(low_dim_data)
ValueError: zero-dimensional arrays cannot be concatenated

Is this a minor bug or am I using it in the wrong way?

Thanks in advance!

@mch5048
Copy link
Author

mch5048 commented Nov 13, 2019

low_dim_data = [] if obs.gripper_open is None else [np.array(self.gripper_open).reshape(-1)] for data in [self.joint_velocities, self.joint_positions, self.joint_forces, self.gripper_pose, self.gripper_joint_positions, self.gripper_touch_forces, self.task_low_dim_state]: if data is not None: low_dim_data.append(data) for data in low_dim_data: return np.concatenate(low_dim_data)

I changed to code as above and it seems like working fine!

@stepjam
Copy link
Owner

stepjam commented Dec 16, 2019

Thanks for pointing out. Fixed in #15.

@stepjam stepjam closed this as completed Dec 16, 2019
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

2 participants