-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parameter handling added to line detector cnn
- Loading branch information
1 parent
476a8ce
commit e3aa6a6
Showing
8 changed files
with
164 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<node pkg="line_follower" type="line_detector_cnn.py" name="line_detector" clear_params="true" output="screen"> | ||
<param name="~with_display" value="0"/> | ||
<param name="~with_GPU" value="1"/> | ||
<param name="~mono" value="0"/> | ||
<param name="~x_width" value="128"/> | ||
<param name="~x_offset" value="-4"/> | ||
<param name="~y_height" value="45"/> | ||
<param name="~y_offset" value="72"/> | ||
<param name="~model_path" value="/home/pi/catkin_ws/src/line_follower/extras/model_jetson"/> | ||
<param name="~image_topic" value="/main_camera/image_raw"/> | ||
</node> | ||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<node pkg="line_follower" type="line_detector_cnn.py" name="line_detector" clear_params="true" output="screen"> | ||
<param name="~with_display" value="0"/> | ||
<param name="~with_GPU" value="0"/> | ||
<param name="~mono" value="1"/> | ||
<param name="~x_width" value="200"/> | ||
<param name="~x_offset" value="-4"/> | ||
<param name="~y_height" value="45"/> | ||
<param name="~y_offset" value="72"/> | ||
<param name="~model_path" value="/home/pi/catkin_ws/src/line_follower/extras/model_pi"/> | ||
<param name="~image_topic" value="/main_camera/image_raw"/> | ||
</node> | ||
|
||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<node pkg="line_follower" type="line_detector_cnn.py" name="line_detector" clear_params="true" output="screen"> | ||
<param name="~with_display" value="0"/> | ||
<param name="~with_GPU" value="0"/> | ||
<param name="~mono" value="0"/> | ||
<param name="~x_width" value="260"/> | ||
<param name="~x_offset" value="15"/> | ||
<param name="~y_height" value="45"/> | ||
<param name="~y_offset" value="72"/> | ||
<param name="~model_path" value="/home/pi/catkin_ws/src/line_follower/extras/model_rover_s"/> | ||
<param name="~image_topic" value="/raspicam_node/image"/> | ||
</node> | ||
|
||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0"?> | ||
<launch> | ||
<node pkg="line_follower" type="line_detector_cnn.py" name="line_detector" clear_params="true" output="screen"> | ||
<param name="~with_display" value="0"/> | ||
<param name="~with_GPU" value="0"/> | ||
<param name="~mono" value="0"/> | ||
<param name="~x_width" value="260"/> | ||
<param name="~x_offset" value="15"/> | ||
<param name="~y_height" value="45"/> | ||
<param name="~y_offset" value="72"/> | ||
<param name="~model_path" value="/home/pi/catkin_ws/src/line_follower/extras/model_rover_s"/> | ||
<param name="~image_topic" value="/raspicam_node/image"/> | ||
</node> | ||
|
||
<node pkg="line_follower" type="line_controller_cnn_rover_s.py" name="line_controller" clear_params="true" output="screen"> | ||
</node> | ||
|
||
|
||
</launch> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#!/usr/bin/env python | ||
|
||
from std_msgs.msg import Int16MultiArray | ||
from geometry_msgs.msg import Twist | ||
import rospy | ||
import time | ||
|
||
def controlRobot(data): | ||
global lastDirection | ||
direction = data.data[0] | ||
|
||
|
||
if direction == 0: | ||
print("forward") | ||
vel_msg.angular.z = 0 | ||
vel_msg.linear.x = 0.32 | ||
elif direction == 1: | ||
print("left") | ||
vel_msg.angular.z = -0.5 | ||
vel_msg.linear.x = 0.32 | ||
lastDirection = 1 | ||
elif direction == 2: | ||
print("right") | ||
vel_msg.angular.z = 0.5 | ||
vel_msg.linear.x = 0.32 | ||
lastDirection = 2 | ||
else: | ||
print("nothing") | ||
if lastDirection == 1: | ||
vel_msg.linear.x = -0.15 | ||
vel_msg.angular.z = 0.5 | ||
else: | ||
vel_msg.linear.x = -0.15 | ||
vel_msg.angular.z = -0.5 | ||
|
||
|
||
velocity_publisher.publish(vel_msg) | ||
|
||
velocity_publisher = rospy.Publisher('/cmd_vel', Twist, queue_size=1) | ||
vel_msg = Twist() | ||
vel_msg.linear.x = 0 | ||
vel_msg.linear.y = 0 | ||
vel_msg.linear.z = 0 | ||
vel_msg.angular.x = 0 | ||
vel_msg.angular.y = 0 | ||
vel_msg.angular.z = 0 | ||
|
||
lastDirection = 1 | ||
|
||
rospy.init_node('line_follower', anonymous=True) | ||
rospy.Subscriber('line_data', Int16MultiArray, controlRobot) | ||
|
||
rospy.spin() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters