ROBOTIS-GIT / turtlebot3_autorace

Autonomous Driving with TurtleBot3
http://turtlebot3.robotis.com
Apache License 2.0
88 stars 50 forks source link

Bad callback errors occurred while detecting the lane, traffic sign, traffic light, etc. #21

Closed wsung1 closed 6 years ago

wsung1 commented 6 years ago

Hi, ROBOTIS! I'd thank you guys for such a great challenge you made! Now I'm working on turtlebot3_autorace packages with following their tutorials (http://emanual.robotis.com/docs/en/platform/turtlebot3/autonomous_driving). Nothing went wrong up to Tutorials: 4. Calibration. However, from Tutorials: 5. Missions I've bumped into bad callback errors that look alike as follows.

5.1. Lane Detection image

5.2. Traffic Sign image

5.3. Traffic Light image

5.4. Parking Lot image

Do they mean that the callback function is not called because the message doesn't arrive at? Please advise me how to approach this problem. Thank you in advance!

kijongGil commented 6 years ago

Hi @wsung1 :) The problem is that the variable declaration position is incorrect. We will update this solve. But if you want to solve right now, move 'self.counter = 1' on line 59 to line 38 for example in detect_lane. 'self.cvBridge = CvBridge()' is same. This issue is the part you found, so if you do a Pull Request we will get your PR. Do you want a PR? Or are we going to fix it? :)

Thanks, Gilbert.

wsung1 commented 6 years ago

Thanks for your reply. Glad to do PR by myself but to my regret I'm not used to yet. Now I'm trying to fix the code, as you directed. I'll let you know what's going on. Keep cool!

moonjongsul commented 6 years ago

Hello, @kijongGil . I'm trying to your answer but I have a problem. In /turtlebot3_autorace/turtlebot3_autorace_detect/nodes/detect_lane.py, line 59 is 'self.sub_image_original = rospy.Subscriber('/detect/image_input', Image, self.cbFindLane, queue_size = 1)' and line 38 is 'self.lightness_white_h = rospy.get_param("~detect/lane/white/lightness_h", 255)'. 'self.counter = 1' on line 88. Where should I move 'self.counter = 1'? Or did you mention another node?

wsung1 commented 6 years ago

Hi, @kijongGil, I don't know why but the line number you mentioned mismatches with my detect_lane.py. What about if you attach your detect_lane.py so that we could fix the code right away. The regional competition is just around the corner, please help us move forward, @kijongGil :)

kijongGil commented 6 years ago

I'm sorry for the confusion. I said the line 38 and 59 are about detect_sign, In the case of detect_lane, self.counter = 1 is on line 88, move to 53 line. It is an error that is referenced before the self.counter is define.

moonjongsul commented 6 years ago

I changed detect_sign, detect_lane as your comment, but I'm still get the same error. Do you have any other solution to recommend?

Thanks, @kijongGil

kijongGil commented 6 years ago

Change this line https://github.com/ROBOTIS-GIT/turtlebot3/blob/467c76bc4fa2e34162f57107388839d82d3bcc0e/turtlebot3_description/urdf/turtlebot3_burger_for_autorace.gazebo.xacro#L157 to ` camera_rgb_optical_frame

rgb/image_raw ` Try again from Calibration part, and when you follow intrinsic part http://emanual.robotis.com/docs/en/platform/turtlebot3/autonomous_driving/#tutorials-42-intrinsic-camera-calibration type follow command. ` $ export AUTO_IN_CALIB=calibration` `$ export GAZEBO_MODE=false` ` $ roslaunch turtlebot3_autorace_camera turtlebot3_autorace_intrinsic_camera_calibration.launch `
moonjongsul commented 6 years ago

The /catkin_ws/src/turtlebot3/turtlebot3_description/urdf/turtlebot3_burger_for_autorace.gazebo.xacro/ on [Remote PC], [SBC] was changed. Then I calibrated some camera matrix param(intrinsic, extrinsic) and each detection param(HSV) according to your comment. Each detection can be checked in rqt and it looks like it's working but the same error occurs.

Thanks for your reply @kijongGil !

kijongGil commented 6 years ago

I'm sorry for late reply. How about your problem?

robotpilot commented 6 years ago

This issue will be closed since there were no actions for a while. You can reopen this issue to show this issue to the users whenever. Thanks.