Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulator error checking #107

Open
jrbaxter0 opened this issue Mar 7, 2022 · 0 comments
Open

Simulator error checking #107

jrbaxter0 opened this issue Mar 7, 2022 · 0 comments
Assignees

Comments

@jrbaxter0
Copy link
Member

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants