# Node error in my code

**URL:** <https://get-help.theconstruct.ai/t/node-error-in-my-code/3043>\
**Category:** ROS Perception in 5 Days\
**Created:** [April 12, 2020, 7:11pm UTC](https://get-help.theconstruct.ai/t/node-error-in-my-code/3043 "2020-04-12T19:11:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![BrayanAndruMontenegro](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/brayanandrumontenegro/32/10_2.png) [@BrayanAndruMontenegro](https://get-help.theconstruct.ai/u/BrayanAndruMontenegro)\
**Post date:** [April 12, 2020, 7:11pm UTC](https://get-help.theconstruct.ai/t/node-error-in-my-code/3043/1 "2020-04-12T19:11:47Z")

</div>

I am applying exercise one of the unit  
1Get Images from a ROS topic and show them with OpenCV  
on my computer but I get the following error:

roslaunch my\_following\_line\_package line\_following\_b.launch  
… logging to /home/mab/.ros/log/ad1ba79e-7cc4-11ea-a78e-4851b73f7096/roslaunch-mab-HP-EliteBook-820-G1-12593.log  
Checking log directory for disk usage. This may take awhile.  
Press Ctrl-C to interrupt  
Done checking log file disk usage. Usage is \<1GB.

started roslaunch server [http://mab-HP-EliteBook-820-G1:38961/](http://mab-HP-EliteBook-820-G1:38961/)

# SUMMARY

PARAMETERS

- /rosdistro: kinetic
- /rosversion: 1.12.14

NODES  
/  
line\_following\_node (my\_following\_line\_package/line\_follower\_basics.py)

ROS\_MASTER\_URI=http://localhost:11311

process[line\_following\_node-1]: started with pid [12610]  
File “/home/mab/catkin\_ws/src/my\_following\_line\_package/src/line\_follower\_basics.py”, line 10  
SyntaxError: Non-ASCII character ‘\xe2’ in file /home/mab/catkin\_ws/src/my\_following\_line\_package/src/line\_follower\_basics.py on line 10, but no encoding declared; see [http://python.org/dev/peps/pep-0263/](http://python.org/dev/peps/pep-0263/) for details  
[line\_following\_node-1] process has died [pid 12610, exit code 1, cmd /home/mab/catkin\_ws/src/my\_following\_line\_package/src/line\_follower\_basics.py \_\_name:=line\_following\_node \_\_log:=/home/mab/.ros/log/ad1ba79e-7cc4-11ea-a78e-4851b73f7096/line\_following\_node-1.log].  
log file: /home/mab/.ros/log/ad1ba79e-7cc4-11ea-a78e-4851b73f7096/line\_following\_node-1\*.log  
all processes on machine have died, roslaunch will exit  
shutting down processing monitor…  
… shutting down processing monitor complete  
done

my code is :

#!/usr/bin/env python  
import rospy  
import roslib  
import sys  
import cv2  
import numpy as np  
from cv\_bridge import CvBridge, CvBridgeError  
from geometry\_msgs.msg import Twist  
from sensor\_msgs.msg import Image  
​  
​  
class LineFollower(object):  
​  
def **init** (self):

```
    self.bridge_object = CvBridge()
    self.image_sub = rospy.Subscriber("/camera/rgb/image_raw",Image,self.camera_callback)

```

​  
def camera\_callback(self,data):

```
    try:
        # We select bgr8 because its the OpneCV encoding by default
        cv_image = self.bridge_object.imgmsg_to_cv2(data, desired_encoding="bgr8")
    except CvBridgeError as e:
        print(e)

```

​  
cv2.imshow(“Image window”, cv\_image)  
cv2.waitKey(1)  
​  
​  
def main():  
line\_follower\_object = LineFollower()  
rospy.init\_node(‘line\_following\_node’, anonymous=True)  
try:  
rospy.spin()  
except KeyboardInterrupt:  
print(“Shutting down”)  
cv2.destroyAllWindows()  
​  
if **name** == ‘ **main** ’:  
main()

I appreciate your collaboration

---

<div class="post-metadata">

**Author:** ![bayodesegun](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/bayodesegun/32/10684_2.png) [@bayodesegun](https://get-help.theconstruct.ai/u/bayodesegun)\
**Post date:** [April 13, 2020, 10:45am UTC](https://get-help.theconstruct.ai/t/node-error-in-my-code/3043/2 "2020-04-13T10:45:41Z")

</div>

Hi @BrayanAndruMontenegro,

Could you please indicate the specific course and unit you are following?

---

<div class="post-metadata">

**Author:** ![BrayanAndruMontenegro](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/brayanandrumontenegro/32/10_2.png) [@BrayanAndruMontenegro](https://get-help.theconstruct.ai/u/BrayanAndruMontenegro)\
**Post date:** [April 14, 2020, 2:16am UTC](https://get-help.theconstruct.ai/t/node-error-in-my-code/3043/3 "2020-04-14T02:16:52Z")

</div>

this is in course ROS Perception in 5 Days  
also when I execute the command the following happens:  
user: ~ $ rosrun rqt\_image\_view rqt\_image\_view  
QXcbConnection: XCB error: 2 (BadValue), sequence: 439, resource id: 600, major code: 130 (Unknown), minor code: 3  
QXcbConnection: XCB error: 2 (BadValue), sequence: 440, resource id: 600, major code: 130 (Unknown), minor code: 3  
QXcbConnection: XCB error: 2 (BadValue), sequence: 442, resource id: 600, major code: 130 (Unknown), minor code: 3  
QXcbConnection: XCB error: 2 (BadValue), sequence: 443, resource id: 600, major code: 130 (Unknown), minor code: 3
