Unit 5:Ball kicking project

Hello!
In ball kicking project part 3, trajectory_controller.py file is attached, here given n = 0 and used it as
tau_1 = torque[n][0]
tau_2 = torque[n][1], using this as it as getting an error
" File “/home/user/catkin_ws/src/project_controller/scripts/trajectory_controller.py”, line 23, in main
tau_1 = torque[n][0]
IndexError: invalid index to scalar variable."

and if take n = then didnot get any error but i m not getting the final result that is kicking of ball to goal by
rrbot.
Need help please!
Thanks

Hello @misbahsuhail123 ,

Before running the trajectory_controller.py script, can you make sure that you have the following topics available?

/rrbot/joint1_effort_controller/command
/rrbot/joint2_effort_controller/command

Also, the file torque.npy is not in notebook_ws, the path of the path file should be:

torque = np.load('/home/user/catkin_ws/src/torque.npy')

I’ve updated this in the notebook as well.

Hello!
i am sending u the image showing both the rostopic list and the file name is t.npy not torque.npy

" torque = np.load(’/home/user/catkin_ws/src/torque.npy’) "
so i changed it in the code with this name, pls update it in notebook and also name of pkg name is written rrbot_controller while we are working in project_controller package.

" torque = np.load(’/home/user/catkin_ws/src/t.npy’) "

i ran trajectory_controller.py again but it did nothing. its image also attached.

Kindly help in solving this problem. Did u try to run it on ur side?
Thanks