Giter VIP home page Giter VIP logo

Comments (1)

cgokmen avatar cgokmen commented on August 19, 2024

Try

def get_room_type_by_point(self, xy):
"""
Return the room type given a point
:param xy: 2D location in world reference frame (metric)
:return: room type that this point is in or None, if this point is not on the room segmentation map
"""
x, y = self.world_to_seg_map(xy)
if x < 0 or x >= self.room_sem_map.shape[0] or y < 0 or y >= self.room_sem_map.shape[1]:
return None
sem_id = self.room_sem_map[x, y]
# room boundary
if sem_id == 0:
return None
else:
return self.room_sem_id_to_sem_name[sem_id]
def get_room_instance_by_point(self, xy):
"""
Return the room instance given a point
:param xy: 2D location in world reference frame (metric)
:return: room instance that this point is in or None, if this point is not on the room segmentation map
"""
x, y = self.world_to_seg_map(xy)
if x < 0 or x >= self.room_ins_map.shape[0] or y < 0 or y >= self.room_ins_map.shape[1]:
return None
ins_id = self.room_ins_map[x, y]
# room boundary
if ins_id == 0:
return None
else:
return self.room_ins_id_to_ins_name[ins_id]

from igibson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.