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 872abc9 commit 9aa510c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions mini_pupper_interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ rosidl_generate_interfaces(${PROJECT_NAME}
"srv/PlayMusic.srv"
"srv/StopMusic.srv"
"msg/LineDetectionResult.msg"
"msg/AiLineRecognitionResult.msg"
DEPENDENCIES std_msgs # Add packages that above messages depend on, in this case geometry_msgs for Sphere.msg
)

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

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 @@ -49,7 +50,7 @@ def _vel_callback(self, msg):
velocity_cmd = Twist()

if msg.linear != '':
self.linear_vel = float(msg.linear) * 2 # Scale the linear velocity
self.linear_vel = float(msg.linear) / 5 # Scale the linear velocity
self.angular_vel = float(msg.angular) / 3 # Scale the angular velocity

control_linear = self.pid_linear(self.linear_vel)
Expand Down

0 comments on commit 9aa510c

Please sign in to comment.