generate_cached_setup.py 9.0 KB

123456789101112131415161718192021222324252627282930
  1. # -*- coding: utf-8 -*-
  2. from __future__ import print_function
  3. import os
  4. import stat
  5. import sys
  6. # find the import for catkin's python package - either from source space or from an installed underlay
  7. if os.path.exists(os.path.join('/opt/ros/melodic/share/catkin/cmake', 'catkinConfig.cmake.in')):
  8. sys.path.insert(0, os.path.join('/opt/ros/melodic/share/catkin/cmake', '..', 'python'))
  9. try:
  10. from catkin.environment_cache import generate_environment_script
  11. except ImportError:
  12. # search for catkin package in all workspaces and prepend to path
  13. for workspace in '/home/neousys/autoware.ai/install/tablet_socket_msgs;/home/neousys/autoware.ai/install/autoware_msgs;/home/neousys/autoware.ai/install/autoware_config_msgs;/home/neousys/ros_drive/catkin_ws_sensor/devel;/home/neousys/ros_drive/catkin_ws_control/devel;/home/neousys/ros_drive/catkin_ws_msg/devel;/home/neousys/autoware.ai/install/ymc;/home/neousys/autoware.ai/install/xsens_driver;/home/neousys/autoware.ai/install/wf_simulator;/home/neousys/autoware.ai/install/lattice_planner;/home/neousys/autoware.ai/install/waypoint_planner;/home/neousys/autoware.ai/install/waypoint_maker;/home/neousys/autoware.ai/install/way_planner;/home/neousys/autoware.ai/install/vlg22c_cam;/home/neousys/autoware.ai/install/vision_ssd_detect;/home/neousys/autoware.ai/install/vision_segment_enet_detect;/home/neousys/autoware.ai/install/vision_lane_detect;/home/neousys/autoware.ai/install/vision_darknet_detect;/home/neousys/autoware.ai/install/vision_beyond_track;/home/neousys/autoware.ai/install/vel_pose_diff_checker;/home/neousys/autoware.ai/install/vehicle_socket;/home/neousys/autoware.ai/install/vehicle_sim_model;/home/neousys/autoware.ai/install/vehicle_model;/home/neousys/autoware.ai/install/vehicle_gazebo_simulation_launcher;/home/neousys/autoware.ai/install/vehicle_gazebo_simulation_interface;/home/neousys/autoware.ai/install/vehicle_engage_panel;/home/neousys/autoware.ai/install/vehicle_description;/home/neousys/autoware.ai/install/trafficlight_recognizer;/home/neousys/autoware.ai/install/op_utilities;/home/neousys/autoware.ai/install/op_simulation_package;/home/neousys/autoware.ai/install/op_local_planner;/home/neousys/autoware.ai/install/op_global_planner;/home/neousys/autoware.ai/install/lidar_kf_contour_track;/home/neousys/autoware.ai/install/op_ros_helpers;/home/neousys/autoware.ai/install/ff_waypoint_follower;/home/neousys/autoware.ai/install/dp_planner;/home/neousys/autoware.ai/install/op_simu;/home/neousys/autoware.ai/install/op_planner;/home/neousys/autoware.ai/install/op_utility;/home/neousys/autoware.ai/install/lidar_euclidean_cluster_detect;/home/neousys/autoware.ai/install/vector_map_server;/home/neousys/autoware.ai/install/road_occupancy_processor;/home/neousys/autoware.ai/install/costmap_generator;/home/neousys/autoware.ai/install/object_map;/home/neousys/autoware.ai/install/naive_motion_predict;/home/neousys/autoware.ai/install/lanelet_aisan_converter;/home/neousys/autoware.ai/install/map_file;/home/neousys/autoware.ai/install/libvectormap;/home/neousys/autoware.ai/install/lane_planner;/home/neousys/autoware.ai/install/imm_ukf_pda_track;/home/neousys/autoware.ai/install/decision_maker;/home/neousys/autoware.ai/install/vector_map;/home/neousys/autoware.ai/install/vector_map_msgs;/home/neousys/autoware.ai/install/vectacam;/home/neousys/autoware.ai/install/udon_socket;/home/neousys/autoware.ai/install/twist_generator;/home/neousys/autoware.ai/install/twist_gate;/home/neousys/autoware.ai/install/twist_filter;/home/neousys/autoware.ai/install/twist2odom;/home/neousys/autoware.ai/install/tablet_socket;/home/neousys/autoware.ai/install/runtime_manager;/home/neousys/autoware.ai/install/mqtt_socket;/home/neousys/autoware.ai/install/state_machine_lib;/home/neousys/autoware.ai/install/sound_player;/home/neousys/autoware.ai/install/sick_lms5xx;/home/neousys/autoware.ai/install/sick_ldmrs_tools;/home/neousys/autoware.ai/install/sick_ldmrs_driver;/home/neousys/autoware.ai/install/sick_ldmrs_msgs;/home/neousys/autoware.ai/install/sick_ldmrs_description;/home/neousys/autoware.ai/install/points2image;/home/neousys/autoware.ai/install/rosinterface;/home/neousys/autoware.ai/install/rosbag_controller;/home/neousys/autoware.ai/install/pure_pursuit;/home/neousys/autoware.ai/install/points_preprocessor;/home/neousys/autoware.ai/install/mpc_follower;/home/neousys/autoware.ai/install/lidar_localizer;/home/neousys/autoware.ai/install/emergency_handler;/home/neousys/autoware.ai/install/autoware_health_checker;/home/neousys/autoware.ai/install/as;/home/neousys/autoware.ai/install/ros_observer;/home/neousys/autoware.ai/install/roi_object_filter;/home/neousys/autoware.ai/install/range_vision_fusion;/home/neousys/autoware.ai/install/pos_db;/home/neousys/autoware.ai/install/points_downsampler;/home/neousys/autoware.ai/install/pixel_cloud_fusion;/home/neousys/autoware.ai/install/pcl_omp_registration;/home/neousys/autoware.ai/install/pc2_downsampler;/home/neousys/autoware.ai/install/oculus_socket;/home/neousys/autoware.ai/install/obj_db;/home/neousys/autoware.ai/install/nmea_navsat;/home/neousys/autoware.ai/install/ndt_tku;/home/neousys/autoware.ai/install/ndt_gpu;/home/neousys/autoware.ai/install/ndt_cpu;/home/neousys/autoware.ai/install/multi_lidar_calibrator;/home/neousys/autoware.ai/install/microstrain_driver;/home/neousys/autoware.ai/install/memsic_imu;/home/neousys/autoware.ai/install/marker_downsampler;/home/neousys/autoware.ai/install/map_tools;/home/neousys/autoware.ai/install/map_tf_generator;/home/neousys/autoware.ai/install/log_tools;/home/neousys/autoware.ai/install/lidar_shape_estimation;/home/neousys/autoware.ai/install/lidar_point_pillars;/home/neousys/autoware.ai/install/lidar_naive_l_shape_detect;/home/neousys/autoware.ai/install/lidar_fake_perception;/home/neousys/autoware.ai/install/lidar_apollo_cnn_seg_detect;/home/neousys/autoware.ai/install/libwaypoint_follower;/home/neousys/autoware.ai/install/lgsvl_simulator_bridge;/home/neousys/autoware.ai/install/lanelet2_extension;/home/neousys/autoware.ai/install/kvaser;/home/neousys/autoware.ai/install/kitti_launch;/home/neousys/autoware.ai/install/kitti_player;/home/neousys/autoware.ai/install/kitti_box_publisher;/home/neousys/autoware.ai/install/javad_navsat_driver;/home/neousys/autoware.ai/install/integrated_viewer;/home/neousys/autoware.ai/install/image_processor;/home/neousys/autoware.ai/install/hokuyo;/home/neousys/autoware.ai/install/graph_tools;/home/neousys/autoware.ai/install/gnss_localizer;/home/neousys/autoware.ai/install/gnss;/home/neousys/autoware.ai/install/glviewer;/home/neousys/autoware.ai/install/gazebo_world_description;/home/neousys/autoware.ai/install/gazebo_imu_description;/home/neousys/autoware.ai/install/gazebo_camera_description;/home/neousys/autoware.ai/install/garmin;/home/neousys/autoware.ai/install/freespace_planner;/home/neousys/autoware.ai/install/fastvirtualscan;/home/neousys/autoware.ai/install/ekf_localizer;/home/neousys/autoware.ai/install/ds4_msgs;/home/neousys/autoware.ai/install/ds4_driver;/home/neousys/autoware.ai/install/detected_objects_visualizer;/home/neousys/autoware.ai/install/decision_maker_panel;/home/neousys/autoware.ai/install/data_preprocessor;/home/neousys/autoware.ai/install/custom_msgs;/home/neousys/autoware.ai/install/carla_autoware_bridge;/home/neousys/autoware.ai/install/calibration_publisher;/home/neousys/autoware.ai/install/autoware_system_msgs;/home/neousys/autoware.ai/install/autoware_rviz_plugins;/home/neousys/autoware.ai/install/autoware_quickstart_examples;/home/neousys/autoware.ai/install/autoware_pointgrey_drivers;/home/neousys/autoware.ai/install/autoware_driveworks_interface;/home/neousys/autoware.ai/install/autoware_connector;/home/neousys/autoware.ai/install/autoware_camera_lidar_calibrator;/home/neousys/autoware.ai/install/astar_search;/home/neousys/autoware.ai/install/amathutils_lib;/home/neousys/autoware.ai/install/autoware_map_msgs;/home/neousys/autoware.ai/install/autoware_launcher_rviz;/home/neousys/autoware.ai/install/autoware_launcher;/home/neousys/autoware.ai/install/autoware_lanelet2_msgs;/home/neousys/autoware.ai/install/autoware_external_msgs;/home/neousys/autoware.ai/install/autoware_driveworks_gmsl_interface;/home/neousys/autoware.ai/install/autoware_can_msgs;/home/neousys/autoware.ai/install/autoware_build_flags;/home/neousys/autoware.ai/install/autoware_bag_tools;/home/neousys/autoware.ai/install/adi_driver;/opt/ros/melodic'.split(';'):
  14. python_path = os.path.join(workspace, 'lib/python2.7/dist-packages')
  15. if os.path.isdir(os.path.join(python_path, 'catkin')):
  16. sys.path.insert(0, python_path)
  17. break
  18. from catkin.environment_cache import generate_environment_script
  19. code = generate_environment_script('/home/neousys/autoware.ai/build/runtime_manager/devel/env.sh')
  20. output_filename = '/home/neousys/autoware.ai/build/runtime_manager/catkin_generated/setup_cached.sh'
  21. with open(output_filename, 'w') as f:
  22. # print('Generate script for cached setup "%s"' % output_filename)
  23. f.write('\n'.join(code))
  24. mode = os.stat(output_filename).st_mode
  25. os.chmod(output_filename, mode | stat.S_IXUSR)