-
Notifications
You must be signed in to change notification settings - Fork 524
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
[WIP] add ROS Plugin #168
base: main
Are you sure you want to change the base?
[WIP] add ROS Plugin #168
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @brucecui97, thank you for all work done towards ROS integration with Habitat.
- Habitat simulator doesn't support multithreading and each instance should be initiated in separate process.
- Maybe you don't need
habitat.Env
here and can usehabitat_sim
only as you're interested in simulation part, not task definition, baselines training, visualizations. - You use a lot of Habitat Sim internal members and methods. Maybe worth to create wrapper class to keep all that internal calls with one class. @erikwijmans maybe you can comment here on orientations and transformation calls.
def __init__(self, env_config_file): | ||
threading.Thread.__init__(self) | ||
self.env = habitat.Env(config=habitat.get_config(env_config_file)) | ||
self.env._sim._sim.agents[0].move_filter_fn = self.env._sim._sim._step_filter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is not needed.
vz = -state.velocity[0] | ||
vx = state.velocity[1] | ||
dt = self._dt | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scene_node = self.env._sim._sim.agents[0].scene_node
Then all the self.env._sim._sim.agents[0].scene_node
bellow can be replaced with scene_node
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actions with state (like these) is something we should support. Then we'd just be able to add a new action for the agent to take (for both variants).
) | ||
self.env._sim._sim.agents[0].scene_node.rotation = self.env._sim._sim.agents[ | ||
0 | ||
].scene_node.rotation.normalized() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from habitat_sim.agent.controls.default_controls import LookLeft
from habitat_sim.agent.controls import ActuationSpec
...
LookLeft()(self.env._sim._sim.agents[0].scene_node, ActuationSpec(yaw * dt))
self._pub_depth.publish(np.float32(self.observations["depth"].ravel()) * 10) | ||
|
||
depth_np = np.float32(self.observations["depth"].ravel()) | ||
pointgoal_np = np.float32(self.observations["pointgoal"].ravel()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pointgoal_np = np.float32(self.observations["pointgoal"].ravel()) | |
pointgoal_np = np.float32(self.observations["pointgoal_with_compass_gps"].ravel()) |
Motivation and Context
The ROS Plugin helps to accomplish the following:
Purpose of WIP Pull request
Would like to please receive feed back on current implementation of the ROS plugin. Some main limtations of the current implementation are the following:
Links to Habitat-ROS Integration Video Demos
Navigating Habitat environment with ROS navigation package: https://youtu.be/VYfZ4wghpRA
Navigating Gazebo (ROS' simulator) environment with Habitat trained agent: https://youtu.be/EaU_a6MIeIE
Navigating Habitat environment with Habitat trained agent with ROS in the loop: https://youtu.be/eYywGkWd_0E
Link to Slides used to Explain High Level Implementation of ROS Plugin
https://1drv.ms/p/s!AhI7FLXI6kP7hfA3lsetrnm2y0Uq9g
How Has This Been Tested
Ran locally
Types of changes
Checklist