This bug leads to cryptic errors when the cause if very straightforward. Rather than crashing and giving a convenient error message when a necessary parameter wasn't given, the simulator skips to the next section of code.
This same practice may exist in several files in rktl_sim
Before:
# Setting up ball
ball_img_path = rospy.get_param("~BALL_IMG_PATH", None)
if ball_img_path is not None:
self.ball_id = id
self.window.createAsset(
self.ball_id, ball_radius * 2, ball_radius * 2, imgPath=ball_img_path)
id += 1
After:
# Setting up ball
self.ball_id = id
self.window.createAsset(
self.ball_id, ball_radius * 2, ball_radius * 2, imgPath=rospy.get_param("~BALL_IMG_PATH"))
id += 1
or
# Setting up ball
ball_img_path = rospy.get_param("~BALL_IMG_PATH")
self.ball_id = id
self.window.createAsset(
self.ball_id, ball_radius * 2, ball_radius * 2, imgPath=ball_img_path)
id += 1
This bug leads to cryptic errors when the cause if very straightforward. Rather than crashing and giving a convenient error message when a necessary parameter wasn't given, the simulator skips to the next section of code.
This same practice may exist in several files in
rktl_simBefore:
After:
or