Skip to content

User/isaiahrivera21/pr object detection #187

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

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
d12c73d
added python scripts for lane following
isaiahrivera21 Mar 10, 2024
62e5723
Added file
isaiahrivera21 Mar 11, 2024
6a0810b
Following much better
isaiahrivera21 Mar 12, 2024
eb5d0c1
modified Lanedetection to be more stable
Vaibhav-Hariani Mar 12, 2024
aa399eb
Added turtlebot velocity controller
nathanwolfsonkin Mar 12, 2024
3c1777a
lane follow POGGERS
Vaibhav-Hariani Mar 12, 2024
c026ae5
added test_lf.py, creating new branch
Vaibhav-Hariani Mar 20, 2024
d875655
first pass (completely blind) of making lane detection work with two …
Vaibhav-Hariani Mar 21, 2024
f3f0ffe
Attempt at making lane detection work with 2 cameras, done fully blind
Vaibhav-Hariani Mar 21, 2024
a35af57
Initial Commit for UI Branch: Created basic structure and defined wha…
Vaibhav-Hariani Mar 27, 2024
bb39941
lane following with split cameras fully implemented
Vaibhav-Hariani Mar 28, 2024
3fd939f
Merge pull request #180 from CooperUnion/user/Vaibhav-Hariani/functio…
Vaibhav-Hariani Mar 28, 2024
f4cbfc5
added handlers for edge cases
Vaibhav-Hariani Mar 28, 2024
0a3c40c
added error signal compatability
nathanwolfsonkin Mar 28, 2024
d37836f
Added ROS Integration to UI, and simple ROS2 webcam publisher. Cleane…
Vaibhav-Hariani Mar 28, 2024
95b7453
Modified LaneDetection.py to publish images (in a very clean manner),…
Vaibhav-Hariani Mar 29, 2024
1c2be35
minor changes
Vaibhav-Hariani Mar 29, 2024
0ec3b77
Cleaned up the repository: Trying to find ways to work with a real ti…
Vaibhav-Hariani Apr 9, 2024
bd90cad
First State Machine: Stop for 5 seconds. Go for 5 Seconds
Vaibhav-Hariani Apr 10, 2024
5c771fd
Distance to object communicated over ROS
Vaibhav-Hariani Apr 10, 2024
a7dd3a8
The U.I Lives! Squashed all existing bugs (As far as I'm aware), mean…
Vaibhav-Hariani Apr 10, 2024
49a334f
Added Publisher, specified goals in Homepage.py
Vaibhav-Hariani Apr 10, 2024
ba26d43
Added changes to Homepage & Lane_Detection: It Works!
Vaibhav-Hariani Apr 12, 2024
2d43bd7
Fixed Lane_Detection, publishing all images from the turtlebot
Vaibhav-Hariani Apr 12, 2024
b201bb8
Rename 🚗 Homepage.py to Homepage.py
Vaibhav-Hariani Apr 15, 2024
8eb6918
Rename 🛑 Object_Detection.py to Object_Detection.py
Vaibhav-Hariani Apr 15, 2024
075d74f
Rename 🛣 Lane_Detection.py to Lane_Detection.py
Vaibhav-Hariani Apr 15, 2024
233047d
Blind attempt of Lane Determination: Will need to characterize, tune,…
Vaibhav-Hariani Apr 16, 2024
7f8aeec
Finalized UI publisher (For some reason it was not committed before),…
Vaibhav-Hariani Apr 18, 2024
0fe35db
Finished up the UI side of things for the most part: Need to add cust…
Vaibhav-Hariani Apr 18, 2024
0986c5a
Finished up the UI barring publisher, added daniels code
Vaibhav-Hariani Apr 18, 2024
ed9cf28
Replaced some testing code
Vaibhav-Hariani Apr 18, 2024
cccf83b
Removed some more testing code
Vaibhav-Hariani Apr 18, 2024
f7e4d12
something changed & I can't tell you what it is
Vaibhav-Hariani Apr 18, 2024
a7f2d9a
"Typos & Some running issues"
Vaibhav-Hariani Apr 18, 2024
64d6c18
Merge pull request #182 from CooperUnion/user/Vaibhav_Hariani/which_l…
giuseppequaratino Apr 20, 2024
f2f42af
Purged Log Files - Vaihav
Vaibhav-Hariani Apr 20, 2024
826f578
Lane detection updated to be able to send compiled data of slider val…
Vaibhav-Hariani Apr 20, 2024
3f2e70b
just in case
Vaibhav-Hariani Apr 21, 2024
a588c03
Pushed yolo custom message package and updated object detection module
Vaibhav-Hariani May 15, 2024
c9b79d3
added pretrained weights for model
Vaibhav-Hariani May 15, 2024
6783967
Added Isaiah's object detection code to repo
Vaibhav-Hariani May 16, 2024
6ca6217
Uploaded latest iteration of object detection with custom message
Vaibhav-Hariani May 21, 2024
c819b25
Merge branch 'user/isaiahrivera21/object_detection_with_custom_messag…
Vaibhav-Hariani May 21, 2024
7f945c8
Added Placing Objects globall workspace
Vaibhav-Hariani May 21, 2024
1e297fd
Deleted Old Object Detection
Vaibhav-Hariani May 21, 2024
854eb21
reformatted files to pep-8 standard
Vaibhav-Hariani May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,12 @@
.vscode
__pycache__
build
ros2/lanefollowingtest/LaneVideo.mp4
log/COLCON_IGNORE
log/latest
log/latest_version-check
log/version-check_2024-03-28_13-31-27/logger_all.log
ros2/log/latest_build
ros2/log/build_2024-03-28_13-35-11/logger_all.log
ros2/log/build_2024-03-28_13-39-36/logger_all.log
ros2/log/latest_build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>place_object_globally_package</name>
<version>0.0.0</version>
<description>TODO: Package description</description>
<maintainer email="vaibhav.hariani@gmail.com">eeadmin</maintainer>
<license>TODO: License declaration</license>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>python3-pytest</test_depend>

<export>
<build_type>ament_python</build_type>
</export>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import rclpy
from rclpy.node import Node
from nav_msgs.msg import Odometry
from geometry_msgs.msg import Pose, PoseWithCovariance


class ObjGlobalLocation(Node):
def __init__(self):
super().__init__('Object_Global_Location_Node')

# Might need to apply on offset because the object location is given wrt the zed's left camera

# in this contect we only care about the vehicle's x and y pos
self.vehicle_x = None
self.vehicle_y = None

self.obj_x = None
self.obj_y = None

# Subscribe to get information on the vehicle and object positions
self.obj_information_subscription = self.create_subscription(
Yolo,
'dist_at_obj',
self.obj_information_callback,
10)

self.obj_information_subscription

self.vehicle_position_subscription = self.create_subscription(
Odometry,
'encoder_odom',
self.vehicle_position_callback,
10)

self.vehicle_position_subscription

# Publish the object's location wrt to where we started
self.object_global_location_publisher = self.create_publisher(Pose, '/pose', 10) # want to change to pose with covar in the future

timer_period = 0.1 # seconds
self.timer = self.create_timer(timer_period, self.timer_callback)

def obj_information_callback(self,msg):
self.obj_x = msg.x
self.obj_y = msg.y

def vehicle_position_callback(self,msg):
self.vehicle_x = msg.pose.pose.position.x
self.vehicle_y = msg.pose.pose.position.y

def timer_callback(self):
obj_location = PoseWithCovariance()

# Covariance Matrix
obj_location.covariance = [1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 1.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0,]

obj_location.pose.position.x = self.vehicle_x + self.obj_x
obj_location.pose.position.y = self.vehicle_y + self.obj_y
obj_location.pose.position.z = 0.0

obj_location.pose.orientation.x = 0.0
obj_location.pose.orientation.y = 0.0
obj_location.pose.orientation.z = 0.0
obj_location.pose.orientation.w = 0.0

self.object_global_location_publisher.publish(obj_location)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[develop]
script_dir=$base/lib/place_object_globally_package
[install]
install_scripts=$base/lib/place_object_globally_package
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from setuptools import find_packages, setup

package_name = 'place_object_globally_package'

setup(
name=package_name,
version='0.0.0',
packages=find_packages(exclude=['test']),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + package_name, ['package.xml']),
],
install_requires=['setuptools'],
zip_safe=True,
maintainer='eeadmin',
maintainer_email='vaibhav.hariani@gmail.com',
description='TODO: Package description',
license='TODO: License declaration',
tests_require=['pytest'],
entry_points={
'console_scripts': [
'place_object_globally_node = place_object_globally_package.place_object_globally_node:main'
],
},
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_copyright.main import main
import pytest


# Remove the `skip` decorator once the source file(s) have a copyright header
@pytest.mark.skip(reason='No copyright header has been placed in the generated source file.')
@pytest.mark.copyright
@pytest.mark.linter
def test_copyright():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found errors'
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Copyright 2017 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_flake8.main import main_with_errors
import pytest


@pytest.mark.flake8
@pytest.mark.linter
def test_flake8():
rc, errors = main_with_errors(argv=[])
assert rc == 0, \
'Found %d code style errors / warnings:\n' % len(errors) + \
'\n'.join(errors)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2015 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_pep257.main import main
import pytest


@pytest.mark.linter
@pytest.mark.pep257
def test_pep257():
rc = main(argv=['.', 'test'])
assert rc == 0, 'Found code style errors / warnings'
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
isolated
Empty file.
Loading
Loading