Skip to content

Commit

Permalink
Bug fix for _ & spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
KavitShah1998 committed Jan 23, 2025
1 parent 6ed6ced commit c3c60b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
4 changes: 3 additions & 1 deletion spot_rl_experiments/spot_rl/utils/cg_waypoint_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ def add_furniture(self, furniture_name: str):
new_furniture_relation = {
"object1": {
"id": new_entity_id,
"object_tag": furniture_name,
"object_tag": furniture_name.replace(
"_", " "
), # we should not have '_'s inside object_tags
"bbox_extent": [0.5, 0.5, place_target[2] / 2.0],
"bbox_center": [
place_target[0],
Expand Down
17 changes: 9 additions & 8 deletions spot_rl_experiments/spot_rl/utils/skill_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,15 +374,16 @@ def execute_skills(self): # noqa: C901
bbox_extent = np.array([float(v) for v in bbox_info[3:6]])

if ":" in bbox_info[6]:
query_class_names = bbox_info[6].split(":")[1]
query_class_names = query_class_names.split("_")
if query_class_names[0].isdigit():
query_class_names = ["_".join(query_class_names[1:])]
else:
query_class_names = ["_".join(query_class_names)]
query_class_names = bbox_info[6].split(":")[1] # For exploration
else:
query_class_names = bbox_info[6:]
query_class_names[0] = query_class_names[0].replace("_", " ")
query_class_names = bbox_info[6] # For nav with view poses

# Strip id from query_class_name
query_class_names = query_class_names.split("_")
if query_class_names[0].isdigit():
query_class_names = [" ".join(query_class_names[1:])]
else:
query_class_names = [" ".join(query_class_names)]

if robot_holding:
rospy.set_param("/viz_place", query_class_names[0])
Expand Down

0 comments on commit c3c60b2

Please sign in to comment.