Skip to content

Comments

Opencv testing#14

Open
hgs2007 wants to merge 22 commits intomainfrom
opencv_testing
Open

Opencv testing#14
hgs2007 wants to merge 22 commits intomainfrom
opencv_testing

Conversation

@hgs2007
Copy link
Contributor

@hgs2007 hgs2007 commented Nov 5, 2025

implemented a path-finding algorithm to keep the kart on the track. btw this branch is for pathfinding even tho its called opencv_testing

# calculate speed command as % of total
speed_command /= max_speed

logger.info(f"Theta1: {theta1:.1f}°, Theta2: {theta2:.1f}°")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think a question for @ShayManor :
Is logging in the hotloop slow?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay, not sure if this is still relevant. This is fine because it's on info and when we run we set logger mode to warning. Looking into how logger works, this will make one function call, fail the check, and return. This is fine.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

def info(self, msg, *args, **kwargs):
    if self.isEnabledFor(INFO):
        self._log(INFO, msg, args, **kwargs)

The if fails, so no log is made, and the string format is not evaluated.


speed_command = current_speed

theta1 = -1 * opencv_output[0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might be missing it, but does it handle the case when OpenCV node is unable to find a left or right angle?

@shb-png shb-png requested a review from LelsersLasers November 5, 2025 16:43
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

Successfully merging this pull request may close these issues.

4 participants