• 大小: 1.47MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-02
  • 语言: 其他
  • 标签: python  ROS  

资源简介

ros小车的一些代码,包含底层驱动,导航,建图部分。内有激光雷达驱动,使用需重新编译,可能不能用

资源截图

代码片段和文件信息

#!/usr/bin/env python

import os
import ycm_core

flags = [
‘-Wall‘
‘-Wextra‘
‘-Werror‘
‘-fexceptions‘
‘-DNDEBUG‘
‘-std=c++11‘
‘-x‘
‘c++‘
‘-isystem‘
‘/usr/include‘
‘-isystem‘
‘/usr/local/include‘
‘-isystem‘
‘/opt/ros/‘ + os.getenv(‘ROS_DISTRO‘) + ‘/include‘
‘-isystem‘
‘/home/dell/ROS_training/ros_training_9/okk/devel/include‘
‘-isystem‘
‘/home/dell/ROS_training/ros_training_9/okk/src/robot_bao/include‘
]

compilation_database_folder = ‘‘

if os.path.exists( compilation_database_folder ):
  database = ycm_core.CompilationDatabase( compilation_database_folder )
else:
  database = None

SOURCE_EXTENSIONS = [ ‘.cpp‘ ‘.cxx‘ ‘.cc‘ ‘.c‘ ]

def DirectoryOfThisscript():
  return os.path.dirname( os.path.abspath( __file__ ) )


def MakeRelativePathsInFlagsAbsolute( flags working_directory ):
  if not working_directory:
    return list( flags )
  new_flags = []
  make_next_absolute = False
  path_flags = [ ‘-isystem‘ ‘-I‘ ‘-iquote‘ ‘--sysroot=‘ ]
  for flag in flags:
    new_flag = flag

    if make_next_absolute:
      make_next_absolute = False
      if not flag.startswith( ‘/‘ ):
        new_flag = os.path.join( working_directory flag )

    for path_flag in path_flags:
      if flag == path_flag:
        make_next_absolute = True
        break

      if flag.startswith( path_flag ):
        path = flag[ len( path_flag ): ]
        new_flag = path_flag + os.path.join( working_directory path )
        break

    if new_flag:
      new_flags.append( new_flag )
  return new_flags


def IsHeaderFile( filename ):
  extension = os.path.splitext( filename )[ 1 ]
  return extension in [ ‘.h‘ ‘.hxx‘ ‘.hpp‘ ‘.hh‘ ]


def GetCompilationInfoForFile( filename ):
  if IsHeaderFile( filename ):
    basename = os.path.splitext( filename )[ 0 ]
    for extension in SOURCE_EXTENSIONS:
      replacement_file = basename + extension
      if os.path.exists( replacement_file ):
        compilation_info = database.GetCompilationInfoForFile(
          replacement_file )
        if compilation_info.compiler_flags_:
          return compilation_info
    return None
  return database.GetCompilationInfoForFile( filename )


def FlagsForFile( filename **kwargs ):
  if database:
    compilation_info = GetCompilationInfoForFile( filename )
    if not compilation_info:
      return None

    final_flags = MakeRelativePathsInFlagsAbsolute(
      compilation_info.compiler_flags_
      compilation_info.compiler_working_dir_ )
  else:
    relative_to = DirectoryOfThisscript()
    final_flags = MakeRelativePathsInFlagsAbsolute( flags relative_to )

  return {
    ‘flags‘: final_flags
    ‘do_cache‘: True
  }

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件         98  2018-08-01 00:07  my_car\.catkin_workspace

     文件        720  2018-08-01 00:07  my_car\.vscode\launch.json

     文件      20036  2018-08-01 00:07  my_car\.vscode\tasks.json

     文件       2644  2018-08-01 00:15  my_car\.ycm_extra_conf.py

     文件         11  2018-10-17 21:14  my_car\build\.built_by

     文件       1161  2018-10-17 21:14  my_car\build\catkin\catkin_generated\version\package.cmake

     文件        520  2018-10-17 21:14  my_car\build\catkin_generated\env_cached.sh

     文件       1320  2018-10-17 21:14  my_car\build\catkin_generated\generate_cached_setup.py

     文件         93  2018-10-17 21:14  my_car\build\catkin_generated\installspace\.rosinstall

     文件        506  2018-10-17 21:14  my_car\build\catkin_generated\installspace\env.sh

     文件        260  2018-10-17 21:14  my_car\build\catkin_generated\installspace\setup.bash

     文件       2741  2018-10-17 21:14  my_car\build\catkin_generated\installspace\setup.sh

     文件        270  2018-10-17 21:14  my_car\build\catkin_generated\installspace\setup.zsh

     文件      12410  2018-10-17 21:14  my_car\build\catkin_generated\installspace\_setup_util.py

     文件        117  2018-10-17 21:14  my_car\build\catkin_generated\metapackages\ros_arduino_bridge\CMakeLists.txt

     文件       1781  2018-10-17 21:14  my_car\build\catkin_generated\order_packages.cmake

     文件        340  2018-10-17 21:14  my_car\build\catkin_generated\order_packages.py

     文件        670  2018-10-17 21:14  my_car\build\catkin_generated\setup_cached.sh

     文件       9976  2018-10-17 21:14  my_car\build\catkin_generated\stamps\Project\interrogate_setup_dot_py.py.stamp

     文件       2711  2018-10-17 21:14  my_car\build\catkin_generated\stamps\Project\order_packages.cmake.em.stamp

     文件       1252  2018-10-17 21:14  my_car\build\catkin_generated\stamps\Project\package.xml.stamp

     文件      12410  2018-10-17 21:14  my_car\build\catkin_generated\stamps\Project\_setup_util.py.stamp

     文件          0  2018-10-17 21:14  my_car\build\CATKIN_IGNORE

     文件        330  2018-10-17 21:14  my_car\build\catkin_make.cache

     文件      25890  2018-10-17 21:14  my_car\build\CMakeCache.txt

     文件       2002  2018-10-17 21:14  my_car\build\CMakeFiles\3.5.1\CMakeCCompiler.cmake

     文件       4556  2018-10-17 21:14  my_car\build\CMakeFiles\3.5.1\CMakeCXXCompiler.cmake

     文件       8640  2018-10-17 21:14  my_car\build\CMakeFiles\3.5.1\CMakeDetermineCompilerABI_C.bin

     文件       8656  2018-10-17 21:14  my_car\build\CMakeFiles\3.5.1\CMakeDetermineCompilerABI_CXX.bin

     文件        402  2018-10-17 21:14  my_car\build\CMakeFiles\3.5.1\CMakeSystem.cmake

............此处省略1306个文件信息

评论

共有 条评论