I have using ros1 - melodic and run in ubuntu 18.04 in Jetson-Nano I trying to access serial port of Jetson-Nano. But when i run with command "python3
serial_modules.py" then no error occurs but not access to serial port If I delete "import rospy" then everything is running fine
Below is the code:
#!/usr/bin/env python3.6
import serial #sudo apt-get install python3-serial
import time
import rospy
def initConnection(portNo, baudRate):
try:
ser = serial.Serial(portNo, baudRate)
print("Device Connected")
return ser
except:
print("Not Connected")
def sendData(se, data, name):
myString = "$"
for x in range(3):
myString += (name[i] + ":" + str(data[i]) + "$")
myString += "\r\n"
try:
se.write(myString.encode())
#print(myString)
except:
print("Data Transmition Failed")
if __name__ == "__main__":
ser = initConnection('/dev/ttyTHS1', 115200) # on jetson replace COM8 with /dev/ttyTHS1 coresponding
while True:
myString = "hello"
ser.write(myString.encode())
time.sleep(1)
Was ROS sourced for sure?
I think sure ...... Can you help me, but I'm also stuck with this error
You have to add more information about your case, what kind of system is it, what kind of robot, what are you trying to do too. I think I know what is the problem though, give me a moment.
thank you .... i have using ros1 - melodic and run in ubuntu 18.04 in Jetson-Nano I trying to access serial port of Jetson-Nana But when i run with command "python3 serial_modules.py" then no error occurs but not access to serial port If I delete "import rospy" then everything is running fine
Add these to the question in the edit please, to keep everything in one place