osrf / rosbook

Example code to accompany the book Programming Robots with ROS
Apache License 2.0
476 stars 237 forks source link

Unable to run the python file red_light_green_light.py #48

Open ibrahimqazi opened 4 years ago

ibrahimqazi commented 4 years ago

Hello My Gazebo simulation is running already and the topic /cmd_vel_mux/input/teleop is there but when I run ./red_light_green_light.py cmd_vel:=cmd_vel_mux/input/teleop there is displayed nothing. Like this:

ibrahim@ibrahim-aspire-v5-591g:~/catkin_workspaces/ros_python_ws/src/wanderbot/src$ ./red_light_green_light.py cmd_vel:=cmd_vel_mux/input/teleop
ibrahim@ibrahim-aspire-v5-591g:~/catkin_workspaces/ros_python_ws/src/wanderbot/src$ 

Can anyone help me to point out the problem ? Thanks

ktro2828 commented 4 years ago

maybe you should change if light_change_time < rospy.Time.now(): not > it works for me!!

ibrahimqazi commented 4 years ago

maybe you should change if light_change_time < rospy.Time.now(): not > it works for me!!

Thank you it worked.

jacobsayono commented 1 year ago

running mine on noetic. i installed turtlebot3 for noetic (book's version is turtlebot for indigo)... mine worked if i do: ~/wanderbot_ws $ roslaunch turtlebot3_gazebo turtlebot3_world.launch and then: ~/wanderbot_ws/src/wanderbot/src $ ./red_light_green_light.py without the cmd_vel stuff!