Skip to content

Commit

Permalink
finalise
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyLai1234 committed Aug 23, 2024
1 parent 0dfa2ee commit 872abc9
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from geometry_msgs.msg import Twist
import time
from mini_pupper_interfaces.msg import AiLineRecognitionResult
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
from langchain_google_vertexai import ChatVertexAI
from langchain_core.messages import HumanMessage
from io import BytesIO
from std_msgs.msg import String
from mini_pupper_interfaces.msg import AiLineRecognitionResult


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
import rclpy
from sensor_msgs.msg import Image
from rclpy.node import Node
from std_msgs.msg import String
import numpy as np
from cv_bridge import CvBridge
from mini_pupper_interfaces.msg import LineDetectionResult


def detect_black_line(frame):
# Convert frame to grayscale
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from geometry_msgs.msg import Twist
import time
from mini_pupper_interfaces.msg import LineDetectionResult
Expand Down Expand Up @@ -50,7 +49,7 @@ def _vel_callback(self, msg):
time.sleep(self.interval)

velocity_cmd = Twist()
velocity_cmd.linear.x = 0.10 / ((abs(float(msg.linear)) + abs(msg.angular)) * 3)
velocity_cmd.linear.x = 0.10 / ((abs(float(msg.linear)) + abs(float(msg.angular))) * 3)
self.vel_publisher_.publish(velocity_cmd)
time.sleep(self.interval)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

import rclpy
from rclpy.node import Node
from std_msgs.msg import String
from geometry_msgs.msg import Twist
import time
from simple_pid import PID
Expand Down Expand Up @@ -62,7 +61,7 @@ def _vel_callback(self, msg):
time.sleep(self.interval)

velocity_cmd = Twist()
velocity_cmd.linear.x = 0.10 / ((abs(float(msg.linear)) + abs(msg.angular)) * 3)
velocity_cmd.linear.x = 0.10 / ((abs(float(msg.linear)) + abs(float(msg.angular))) * 3)
self.vel_publisher_.publish(velocity_cmd)
time.sleep(self.interval)

Expand Down

0 comments on commit 872abc9

Please sign in to comment.