Skip to content

Commit

Permalink
fixed exception import
Browse files Browse the repository at this point in the history
  • Loading branch information
rtjord committed Mar 2, 2024
1 parent f5c4e09 commit 9b340a5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/rktl_sim/rktl_sim/vis_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from nav_msgs.msg import Odometry
import rclpy
import sys
from rclpy.exceptions import ROSInterruptException

from rktl_dependencies.transformations import euler_from_quaternion

Expand All @@ -34,7 +35,7 @@ def __init__(self):
#rospy.init_node("visualizer")
rclpy.init(args=sys.argv)
global node
node = rclpy.create_node("visualizer")
node = rclpy.create_node("visualizer", parameter_overrides=[])

# Collecting global parameters
# field_width = node.get_param('/field/width')
Expand Down Expand Up @@ -64,7 +65,7 @@ def __init__(self):
# car_length = rospy.get_param("~cars/body_length")
self.frame_id = node.declare_parameter("~frame_id", "map").value
self.timeout = node.declare_parameter("~timeout", 10).value
rate = rclpy.create_node('simple_node').create_rate((node.declare_parameter("~rate", 20).value))
rate = rclpy.create_node('simple_node').create_rate((node.declare_parameter("~rate", 20).get_parameter_value().double_value))
car_width = node.declare_parameter("~cars/body_width").value
car_length = node.declare_parameter("~cars/body_length").value

Expand Down Expand Up @@ -182,7 +183,7 @@ def __init__(self):
exit()
try:
rate.sleep()
except rclpy.ROSInterruptException:
except ROSInterruptException:
pass


Expand Down

0 comments on commit 9b340a5

Please sign in to comment.