Skip to content

Commit

Permalink
Update log warn and error
Browse files Browse the repository at this point in the history
  • Loading branch information
hanruihua committed Dec 22, 2024
1 parent c574c1c commit 7ba3b22
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
10 changes: 5 additions & 5 deletions irsim/lib/handler/geometry_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ def get_init_Gh(self):

convex_flag, _ = is_convex_and_ordered(self.init_vertices)

# assert convex_flag, "Polygon Objects are not convex"

G, h = gen_inequal_from_vertex(self.init_vertices)

cone_type = "Rpositive"
if convex_flag:
G, h = gen_inequal_from_vertex(self.init_vertices)
cone_type = "Rpositive"
else:
G, h, cone_type = None, None, None
else:
G, h, cone_type, convex_flag = None, None, None, None

Expand Down
11 changes: 8 additions & 3 deletions irsim/lib/handler/kinematics_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ def create_kinematics(
alpha: list = None,
mode: str = 'steer',
wheelbase: float = None,
role: str = 'robot'
) -> KinematicsHandler:
name = name.lower() if name else None
if name == "omni":
Expand All @@ -105,9 +106,13 @@ def create_kinematics(
return DifferentialKinematics(name, noise, alpha)
elif name == "acker":
return AckermannKinematics(name, noise, alpha, mode, wheelbase)
elif name == 'rigid3d':
return Rigid3DKinematics(name, noise, alpha)
# elif name == 'rigid3d':
# return Rigid3DKinematics(name, noise, alpha)
else:
print(f"Unknown kinematics type: {name}, object will be stationary.")
if role=='robot':
print(f"Unknown kinematics type: {name}, the robot will be stationary.")
else:
pass

return None

2 changes: 1 addition & 1 deletion irsim/world/object_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ def __init__(
GeometryFactory.create_geometry(**shape) if shape is not None else None
)
self.kf = (
KinematicsFactory.create_kinematics(wheelbase=self.wheelbase, **kinematics)
KinematicsFactory.create_kinematics(wheelbase=self.wheelbase, role=role, **kinematics)
if kinematics is not None
else None
)
Expand Down

0 comments on commit 7ba3b22

Please sign in to comment.