Problem in Path Planning Basics

Hey, I get an error
“NameError: name ‘xrange’ is not defined
[viz_osm-2] process has died [pid 7351, exit code 1, cmd /home/user/catkin_ws/src/open_street_map/osm_cartography/scripts/viz_osm name:=viz_osm log:=/home/user/.ros/log/972a20e6-634d-11ee-8c9e-0242c0a86006/viz_osm-2.log].
log file: /home/user/.ros/log/972a20e6-634d-11ee-8c9e-0242c0a86006/viz_osm-2*.log”

It seems that ros is using different version of the python. How do you fix this?

Please provide more details. When did you get that error? Which unit were you working on? Include a screenshot of the whole screen, and any other information that may help us find the error

In any case, the problem is that xrange is a keyword of Python2 and the course was migrated to Python3. We have now corrected the course to not use xrange anymore and use range instead (the Python3 equivalent)

Path Planning Basics: Introduction to Mobile Robot Path Planning: unit 6: Final Project: Roadmap Based Path Planning

  • Exercise 6.3.2 -

The route_network, plan_route and rviz_goal Nodes

roslaunch unit6 open_street_map_planner.launch

Traceback (most recent call last):
File “/home/user/catkin_ws/src/open_street_map/route_network/scripts/plan_route”, line 45, in
from route_network import planner
File “/home/simulations/public_sim_ws/src/all/path_planning_sims/path_planning_intro/route_network/src/route_network/planner.py”, line 423
print traceback.format_exc()
^
SyntaxError: invalid syntax
Traceback (most recent call last):
File “/home/user/catkin_ws/src/open_street_map/route_network/scripts/rviz_goal”, line 51, in
from route_network import planner
File “/home/simulations/public_sim_ws/src/all/path_planning_sims/path_planning_intro/route_network/src/route_network/planner.py”, line 423
print traceback.format_exc()
^
SyntaxError: invalid syntax
[rviz_goal-7] process has died [pid 1762, exit code 1, cmd /home/user/catkin_ws/src/open_street_map/route_network/scripts/rviz_goal __name:=rviz_goal __log:=/home/user/.ros/log/f3f9f242-6744-11ee-af91-0242ac120006/rviz_goal-7.log].
log file: /home/user/.ros/log/f3f9f242-6744-11ee-af91-0242ac120006/rviz_goal-7*.log
[plan_route-6] process has died [pid 1761, exit code 1, cmd /home/user/catkin_ws/src/open_street_map/route_network/scripts/plan_route__name:=plan_route __log:=/home/user/.ros/log/f3f9f242-6744-11ee-af91-0242ac120006/plan_route-6.log].
log file: /home/user/.ros/log/f3f9f242-6744-11ee-af91-0242ac120006/plan_route-6*.log
Traceback (most recent call last):
File “/home/user/catkin_ws/src/open_street_map/route_network/scripts/route_network”, line 78, in
PKG_URL = “Documentation - ROS Wiki” + PKG_NAME
NameError: name ‘PKG_NAME’ is not defined
[INFO] [1696925981.939942, 0.000000]: Map URL: package://unit6/data/berlin_zoo_isolated.osm
[INFO] [1696925981.947984, 343.828000]: [get_geographic_map] package://unit6/data/berlin_zoo_isolated.osm
[route_network-5] process has died [pid 1760, exit code 1, cmd /home/user/catkin_ws/src/open_street_map/route_network/scripts/route_network __name:=route_network __log:=/home/user/.ros/log/f3f9f242-6744-11ee-af91-0242ac120006/route_network-5.log].
log file: /home/user/.ros/log/f3f9f242-6744-11ee-af91-0242ac120006/route_network-5*.log
[pose-8] process has finished cleanly

@rasbot04
I apologize for this new glitch :cold_sweat:. We are looking into it.

Please take the rosject indicated earlier in the meantime.

Hello @rasbot04,

The project was recently migrated to ROS Noetic, and as a result, some of the packages required updates.

All the code has now been updated to Python 3. Kindly review the beginning of the project instructions, where we’ve introduced a new step. This involves cloning a repository from Bitbucket into ~/catkin_ws/src. After building and sourcing, the error you encountered should be resolved.

Kindly inform us whether the issue has been resolved.

Best regards,

Roberto

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.