ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

error in running differetial_drive package

asked 2014-12-14 03:48:26 -0500

mohammad gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-12-14 04:17:52 -0500

130s gravatar image

updated 2014-12-14 08:44:42 -0500

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

$ git clone https://jfstepha@code.google.com/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
edit flag offensive delete link more

Comments

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.

mohammad gravatar image mohammad  ( 2014-12-14 05:08:52 -0500 )edit

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

mohammad gravatar image mohammad  ( 2014-12-14 05:10:32 -0500 )edit

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.

130s gravatar image 130s  ( 2014-12-14 08:42:05 -0500 )edit

Thanks a lot, the problem solved by the last command in your answer.

mohammad gravatar image mohammad  ( 2014-12-14 10:49:28 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-12-14 03:48:26 -0500

Seen: 631 times

Last updated: Dec 14 '14