juancamilog / canbus_interface Goto Github PK
View Code? Open in Web Editor NEWROS interface to a canbus using socketcan and python-can
ROS interface to a canbus using socketcan and python-can
Hi,
I am getting this error when launching the package:
core service [/rosout] found
process[can/listener-1]: started with pid [20476]
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in *bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 763, in run
self.__target(_self.__args, _self.__kwargs)
File "/usr/local/lib/python2.7/dist-packages/python_can-1.4-py2.7.egg/can/notifier.py", line 35, in rx_thread
callback(msg)
File "/usr/local/lib/python2.7/dist-packages/python_can-1.4-py2.7.egg/can/CAN.py", line 42, in __call
return self.on_message_received(msg)
File "/home/matt/catkin_ws/src/canbus_interface/src/canbus_listener.py", line 23, in on_message_received
self.canpub.publish(canframe)
AttributeError: 'canbus_ros_interface' object has no attribute 'canpub'
/home/matt/catkin_ws/src/canbus_interface/src/canbus_listener.py:13: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
self.canpub = rospy.Publisher('data', CanFrame)
Matt
Hi,
Do you recommend a specific can dongle to use with this package?
Thanks,
Matt
Holle:
my code:
def SendBack(data):
msg = can.Message(arbitration_id=0x000601, data = data, extended_id=False)
bus.send(msg)
bus.flush_tx_buffer()
time.sleep(0.001)
try:
Ans = str(bus.recv(timeout=1.0))
except:
print("Error")
return(None)
if(len(Ans) > 10):
return("success")
else:
return(None)
My question is when it lost recv then i cant send any new message.
it can't send any data and any response.
I need to restart Raspberry Pi then CAN bus will be normal.
Please help me to fix this question.
Thank you
Hi, Thank you write this canbus_interface packag! I want to use your package in a RK3288 Hardware platform . But there is not CANbus on this platform. I think about using SPI to CAN chip like MCP2515. Do you think I can use it? Or do you have some suggestions?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.