Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

roslaunch ERROR #27

Closed
Fibird opened this issue May 26, 2016 · 14 comments
Closed

roslaunch ERROR #27

Fibird opened this issue May 26, 2016 · 14 comments

Comments

@Fibird
Copy link
Contributor

Fibird commented May 26, 2016

When I use roslaunch ros_arduino_python arduino.launch, I get this: ERROR: cannot launch node of type [ros_arduino_python/arduino_node.py]: can't locate node [arduino_node.py] in package [ros_arduino_python].

@pirobot
Copy link
Member

pirobot commented May 26, 2016

Can you "roscd ros_arduino_bridge" without error?

@Fibird
Copy link
Contributor Author

Fibird commented May 27, 2016

Yes, it runs without any error. And I met another problem(issue #28). @pirobot

@pirobot
Copy link
Member

pirobot commented May 27, 2016

It sounds like the arduino_node.py file is not executable for you which is odd. Try the following commands:

roscd ros_arduino_python/nodes
chmod u+x arduino_node.py
roslaunch ros_arduino_python arduino.launch

@Fibird
Copy link
Contributor Author

Fibird commented May 28, 2016

I tried these commands, but it output:

Connecting to Arduino on port /dev/ttyACM0 ...
Failed to determine baud rate of Arduino so aborting!
...

@pirobot
Copy link
Member

pirobot commented May 28, 2016

Is your Arduino really connected to /dev/ttyACM0? Make sure you have no other USB devices connected and try again.

Also, try increasing the timeout value in your arduino_params.yaml file. I think the default is 0.1 seconds which is a little too short. Bump it up to 0.5 or even 1.0 and this will give the driver more time to wake up the serial port.

@Fibird
Copy link
Contributor Author

Fibird commented May 28, 2016

Yes, I'm sure my Arduino is connected to /dev/ttyACM0 and no other USB devices. Besides, I increase the timeout value, but it still doesn't work. I looked through source codes and debugged them, and I think the problem may come from the function recv() in file "arduino_driver.py", because it can't return correct value from serial in my Arduino(mega 2560) , every time the program executes commands.

@pirobot
Copy link
Member

pirobot commented May 28, 2016

Can you please give me some more info about your setup? (1) What version of ROS are you using, (2) what branch of the ros_arduino_bridge package are you using (e.g. hydro-devel, indigo-devel) , (3) what type of Arduino are you using, (4) what kind of computer are you running ROS on (e.g. laptop versus Raspberry Pi etc), and (5) what version of Python are you using (e.g. 2.4 versus 3).

@Fibird
Copy link
Contributor Author

Fibird commented May 28, 2016

Info you want to know is as follows:

  1. The version of ROS I'm using is indigo;
  2. The branch is master;
  3. My arduino is arduino Mega 2560;
  4. My computer is laptop only.

@pirobot
Copy link
Member

pirobot commented May 28, 2016

Please try the indigo-devel branch since the master branch is under active development and is not guaranteed to work.

@pirobot
Copy link
Member

pirobot commented May 29, 2016

@sunlcy Does that mean things are working for you now with the indigo-devel branch?

@Fibird
Copy link
Contributor Author

Fibird commented May 29, 2016

@pirobot Very sorry replying to you so late! I need some time to make the indigo-devel branch compatible with my hardware, and I am a little busy recently. I'm trying to spare time to do it, and I will tell you the result as soon as I finish it.

@Fibird
Copy link
Contributor Author

Fibird commented Jun 1, 2016

@pirobot I tested the indigo-devel branch on my computer and arduino board, it works fine. So I think there must be some bugs about the baud rate in the master branch. Anywhere, thanks your help very much! 😄

@pirobot
Copy link
Member

pirobot commented Jun 1, 2016

That's good to hear! I have put a note on top of the master branch README file warning people not to use it. I am adding a number of new features to master and testing them out before merging them to the indigo-devel branch later on.

@pirobot pirobot closed this as completed Jun 1, 2016
@yangqiao95
Copy link

问题,咋改Traceback (most recent call last):
File "/home/yangqiao/catkin_ws/src/bsbot/bsbot_python/nodes/arduino_node.py", line 24, in
from bsbot_python.arduino_driver import Arduino
File "/home/yangqiao/catkin_ws/src/bsbot/bsbot_python/src/bsbot_python/arduino_driver.py", line 264
def get_baud(self):
^
IndentationError: unindent does not match any outer indentation level
[arduino-2] process has died [pid 8072, exit code 1, cmd /home/yangqiao/catkin_ws/src/bsbot/bsbot_python/nodes/arduino_node.py __name:=arduino __log:=/home/yangqiao/.ros/log/c8dfef38-cfba-11e9-8675-50e5498171c8/arduino-2.log].
log file: /home/yangqiao/.ros/log/c8dfef38-cfba-11e9-8675-50e5498171c8/arduino-2*.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants