0
$\begingroup$

Rosanswers logo

hi everyone

I want to use a package named differential_drive which is written as a base_controller for two differential wheeled robot by Jon Stephan.

As i can not install it by source from my zone, i downloded its zip and extract it to my directory. This package consists of some python files and after compiling no node has been constructed. I think .py files are my nodes and i should use them in the launch file as below:

<launch> 
 <node pkg="differential_drive" type="pid_velocity.py" name="lpid_velocity"> <remap from="wheel" to="lwheel"/> <remap from="motor_cmd" to="lmotor_cmd"/> <remap from="wheel_vtarget" to="lwheel_vtarget"/> <remap from="wheel_vel" to="lwheel_vel"/> <rosparam param="Kp">200</rosparam> <rosparam param="Ki">200</rosparam> <rosparam param="Kd">0</rosparam> <rosparam param="out_min">-255</rosparam> <rosparam param="out_max">255</rosparam> <rosparam param="rate">30</rosparam> <rosparam param="timeout_ticks">4</rosparam> <rosparam param="rolling_pts">5</rosparam> </node> <node pkg="differential_drive" type="pid_velocity.py" name="rpid_velocity"> <remap from="wheel" to="rwheel"/> <remap from="motor_cmd" to="rmotor_cmd"/> <remap from="wheel_vtarget" to="rwheel_vtarget"/> <remap from="wheel_vel" to="rwheel_vel"/> <rosparam param="Kp">200</rosparam> <rosparam param="Ki">200</rosparam> <rosparam param="Kd">0</rosparam> <rosparam param="out_min">-255</rosparam> <rosparam param="out_max">255</rosparam> <rosparam param="rate">30</rosparam> <rosparam param="timeout_ticks">4</rosparam> <rosparam param="rolling_pts">5</rosparam> </node> <node pkg="differential_drive" type="virtual_joystick.py" name="virtual_joystick" output="screen"/> <node pkg="differential_drive" type="twist_to_motors.py" name="twist_to_motors" output="screen"> <rosparam param="base_width">0.32</rosparam> </node> </launch> 

But when i run my launch file, ROS can not find nodes and i see these errors:

ERROR: cannot launch node of type [differential_drive/pid_velocity.py]: can't locate node [pid_velocity.py] in package [differential_drive] 
ERROR: cannot launch node of type [differential_drive/pid_velocity.py]: can't locate node [pid_velocity.py] in package [differential_drive] ERROR: cannot launch node of type [differential_drive/virtual_joystick.py]: can't locate node [virtual_joystick.py] in package [differential_drive] ERROR: cannot launch node of type [differential_drive/twist_to_motors.py]: can't locate node [twist_to_motors.py] in package [differential_drive] 

Is it because i just extract zip files to my directory? I mean should i use another command to locate this nodes in package?


Originally posted by mohammad on ROS Answers with karma: 75 on 2014-12-14

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

If you're looking at the wiki of differential_drive, its source repository is git so I first cloned it:

$ git clone https://[email protected]/p/differential-drive $ mv differential-drive differential_drive 

Clearly the folder name and the package name doesn't align so I renamed it.

Then put this directory into somewhere that's included in ROS_PACKAGE_PATH. Then you should be able to eg. rosrun differential_drive twist_to_motors.py.

You didn't mention where and how you got a zip file, but as long as the content isn't "broken", above should work with your zip.

Update:

rosrun and one of the nodes, i see an error which says this file is not a executable.

Make sure the python files are executable. Try, for example:

chmod 755 `rospack find differential_drive`/nodes/twist_to_motors.py 

Originally posted by 130s with karma: 10937 on 2014-12-14

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by mohammad on 2014-12-14:
if you look at wiki link, it does not exist. But the true link is https://code.google.com/p/differential-drive. Because i can not access to its source from linux terminal in my country, i just could downloded it zip file from this link.

Comment by mohammad on 2014-12-14:
if i want to use rosrun and one of the nodes, i see an error which says this file is not a executable.

Comment by 130s on 2014-12-14:
I'm sorry that I have no idea what's going on with your internet connectivity, but sounds like at least you were able to download the source, which is enough.

Comment by mohammad on 2014-12-14:
Thanks a lot, the problem solved by the last command in your answer.

$\endgroup$