rqt joint trajectory controller crashes with division by zero error

asked 2021-09-03 04:32:21 -0500

shyamashi gravatar image

Hi, I have a custom 4 degree of freedom basic manipulator which I made for my own learning. I followed this video to add the controllers and launch files for my robot. Then I run rosrun rqt_joint_trajectory_controller rqt_joint_trajectory_controller. I am able to see the following pic image description

But as soon as I press the red button, I get the error Traceback (most recent call last): File "/opt/ros/melodic/lib/python2.7/dist-packages/rqt_joint_trajectory_controller/joint_trajectory_controller.py", line 427, in _update_cmd_cb dur.append(max(abs(cmd - pos) / max_vel, self._min_traj_dur)) ZeroDivisionError: float division by zero I am on Ubuntu 18.04, ROS Melodic

Pls help Thanks

edit retag flag offensive close merge delete


Faced the same issue. Did you find any solution?

Taaha gravatar image Taaha  ( 2023-03-09 10:50:11 -0500 )edit

In my case I used zero for the velocity values in my urdf. Setting max velocity values of all the joints to something velocity=50 and efforts=1000 worked fine for me. If you notice the what the error says you'll see abs(cmd - pos) / max_vel is the part where the error is happening.

Taaha gravatar image Taaha  ( 2023-03-09 11:24:17 -0500 )edit