ericchen321 / ros_x_habitat

A bridge betwwen the ROS ecosystem and AI Habitat.
100 stars 20 forks source link

Error when running command #12

Open BoLeiChen opened 2 years ago

BoLeiChen commented 2 years ago

Hi, I got an error when trying to run the following command. Can you help me with the following? Thank you very much. python src/scripts/eval_and_vis_habitat.py --input-type rgbd --model-path data/checkpoints/v2/gibson-rgbd-best.pth --task-config configs/setting_4_configs/pointnav_rgbd-mp3d.yaml --episode-id -1 --seed-file-path seeds/2_seeds.csv --log-dir logs --make-maps --map-dir maps --make-plots --plot-dir plots

The specific errors are as follows:

s/mp3d/2t7WUuJeko7/2t7WUuJeko7.glb' specified in Scene Attributes exists in dataset library. I0507 18:58:32.987673 68071 SceneDatasetAttributes.cpp:85] ::addNewSceneInstanceToDataset : Dataset : 'default' : Lighting Layout Attributes no_lights specified in Scene Attributes exists in dataset library. I0507 18:58:32.987699 68071 Simulator.cpp:171] ::reconfigure : createSceneInstance success == true for active scene name : data/scene_datasets/mp3d/2t7WUuJeko7/2t7WUuJeko7.glb with renderer. I0507 18:58:32.987965 68071 simulator.py:221] Loaded navmesh data/scene_datasets/mp3d/2t7WUuJeko7/2t7WUuJeko7.navmesh I0507 18:58:36.142938 68071 AttributesManagerBase.h:281] ::loadAllTemplatesFromPathAndExt : Parsing Object Template library directory: data/objects/locobot_merged for 'object_config.json' files I0507 18:58:36.142992 68071 AttributesManagerBase.h:242] ::loadAllFileBasedTemplates : Loading 1 Object Template templates found in data/objects/locobot_merged I0507 18:58:36.142995 68071 AttributesManagerBase.h:247] ::loadAllFileBasedTemplates : Load Object Template template: locobot_merged.object_config.json I0507 18:58:36.143004 68071 AttributesManagerBase.h:365] ::createFromJsonOrDefaultInternal : Proposing JSON name : data/objects/locobot_merged/locobot_merged.object_config.json from original name : data/objects/locobot_merged/locobot_merged.object_config.json | This file exists. I0507 18:58:36.143105 68071 AbstractObjectAttributesManagerBase.h:183] JSON Configuration File (data/objects/locobot_merged/locobot_merged.object_config.json) based Object Template attributes created and registered. I0507 18:58:36.143112 68071 AttributesManagerBase.h:263] ::loadAllFileBasedTemplates : Loaded file-based templates: 1 I0507 18:58:36.143174 68071 ResourceManager.cpp:1265] Importing Basis files as BC7 for locobot_merged.glb I0507 18:58:36.192312 68071 ResourceManager.cpp:1265] Importing Basis files as BC7 for locobot_merged_convex.glb W0507 18:58:36.195832 68071 PhysicsManager.cpp:248] ::addObject : simpleObjectHandle : locobot_merged W0507 18:58:36.195848 68071 PhysicsManager.cpp:251] ::addObject : newObjectHandle : locobotmerged:0000 Traceback (most recent call last): File "src/scripts/eval_and_vis_habitat.py", line 169, in main() File "src/scripts/eval_and_vis_habitat.py", line 99, in main map_height=200, File "/home/ros/cbl/catkin_ws/src/ros_x_habitat/src/evaluators/habitat_evaluator.py", line 125, in evaluate_and_get_maps observations_per_action = self.env.reset() File "/home/ros/anaconda3/envs/rh/lib/python3.7/contextlib.py", line 74, in inner return func(*args, **kwds) File "/home/ros/cbl/catkin_ws/src/ros_x_habitat/src/envs/habitat_rlenv.py", line 73, in reset return self._env.reset() File "/home/ros/cbl/catkin_ws/src/ros_x_habitat/src/envs/physics_env.py", line 176, in reset obj.motion_type = hsim.physics.MotionType.DYNAMIC AttributeError: 'NoneType' object has no attribute 'motion_type'

ericchen321 commented 2 years ago

Hey @BoLeiChen , I hope you've fixed the problem but if you haven't:

The error here says habitat_sim.physics is a null object. Since the module should be in <path to your conda env>/lib/python3.6/site-packages/habitat_sim/physics.py, I guess something is off with your Habitat Sim installation. I just updated the installation instructions, and for Habitat Sim specifically I'm now suggesting to install from conda as opposed to by building from source. Hope it helps.

Sorry for the late reply. I've been busy with other stuff for the past month.

frischzenger commented 2 years ago

I've also meeting this problem, have you solved it?

frischzenger commented 2 years ago

Hey @BoLeiChen , I hope you've fixed the problem but if you haven't:

The error here says habitat_sim.physics is a null object. Since the module should be in <path to your conda env>/lib/python3.6/site-packages/habitat_sim/physics.py, I guess something is off with your Habitat Sim installation. I just updated the installation instructions, and for Habitat Sim specifically I'm now suggesting to install from conda as opposed to by building from source. Hope it helps.

Sorry for the late reply. I've been busy with other stuff for the past month.

i ve tried both install from source and conda install, both this error I tested the physics env in habitat sim, it works fine,

JulioPlaced commented 1 year ago

Same problem here. ROS agent not working with habitat and getting:

AttributeError: 'NoneType' object has no attribute 'motion_type'

(habitat installed using conda and habitat-sim seems to work properly)

ericchen321 commented 1 year ago

@JulioPlaced I ran the same command the OP used:

python src/scripts/eval_and_vis_habitat.py --input-type rgbd --model-path data/checkpoints/v2/gibson-rgbd-best.pth --task-config configs/setting_4_configs/pointnav_rgbd-mp3d.yaml --episode-id -1 --seed-file-path seeds/2_seeds.csv --log-dir logs --make-maps --map-dir maps --make-plots --plot-dir plots

But I didn't get the error. From your error message I can tell PhysicsEnv.rigid_obj_mgr.get_object_by_handle() returned a NontType object, though it should've returned an object of type habitat_sim._ext.habitat_sim_bindings.ManagedBulletRigidObject which contains motion_type attribute. So probably something went wrong inside that function?

FYI 1) if I take a step back and print out obj_handles I can see

['locobot_merged_:0000']

; 2) I built Habitat Sim 0.2.0 from source but I guess you installed the same version from conda. I'm not expecting any discrepency between source/conda build but considering the fact that get_object_by_handle() resides in Habitat Sim and that method might be where the problem comes from, I may try the conda build as well.

JulioPlaced commented 1 year ago

I got this error while running python src/scripts/roam_with_joy.py but I guess the problem is equivalent as it is related to not correctly getting the object habitat_sim. Habitat-sim physics seem to work fine when running habitat examples. So I don't know why this problem is appearing. Also locobot merged was handled successfully in my case too. Let me try compile habitat 0.2.0 from source instead of using conda, just in case.

SepMJ commented 1 year ago

I've also meeting this problem, have you solved it?

frischzenger commented 1 year ago

I've also meeting this problem, have you solved it?

you need to download default.physics_config.json to data directory