Ex_2.3 rosdep view is empty

I was trying to use the get_laser_full() function and I get this error.

user:~/catkin_ws/src/robot_control$ python lists.py
the rosdep view is empty: call ‘sudo rosdep init’ and ‘rosdep update’
('The value at 0, 360 and 719 are: ', inf, 2.4407100677490234, inf)

Here’s the code I wrote:

from robot_control_class import RobotControl

rc = RobotControl()

a = rc.get_laser_full()

print ("The value at 0, 360 and 719 are: ", a[0], a[360], a[719])

Update:

I updated rosdep. Now I don’t get that error line but my output comes out weird.

Update: Solved

So I had to reconnect to my workspace and then forgot to run the python env script.

source ~/.py3venv/bin/activate
source ~/.catkin_ws_python3/devel/setup.bash

Works fine now…

Hi @shinde619nikhil,

great to hear that you managed to solve the problem.

Keep pushing your ROS Learning.