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

Handle rov launch front camera regex return values #181

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OrionOth
Copy link
Member

It seems that there has been a change in python? and now the re.search function can, instead of returning an empty list, return None. So, that has to be handled with a match statement. This also means now that if the front camera is not connected, it will fail gracefully. As I've implemented here, it will default to the top camera path. Hacks on top of hacks.

I'm sure you python programmers have a better way to do this, but as a rust programmer I would have added a single character:

front_camera_path = re.search(v4l2_regex, v4l2_devices)?.group(1)

It seems that there has been a change in python? and now the re.search
function can, instead of returning an empty list, return None. So, that
has to be handled with a match statement. This also means now that if
the front camera is not connected, it will fail gracefully. As I've
implemented here, it will default to the top camera path. Hacks on top
of hacks.
@mike-matera
Copy link
Member

Would you look at my branch called launch_microros_agent? I have made conflicting changes the Liam needs:

https://github.com/CabrilloRoboticsClub/cabrillo_rov_2023/tree/launch-micro-ros-agent

Also, the behavior hasn't changed. The search function either returns a Match object or None.

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.

2 participants