ROS---1

1. (Python & C++) What is a CMakeList? Is it related to a make file used for compiling C++ objects? If yes then what is the difference between the two?
1.What is a CMakeList?

        The file CMakeLists.txt is the input to the CMake build system for building software packages. Any CMake-compliant package contains one or more CMakeLists.txt file that describe how to build the code and where to install it to. The CMakeLists.txt file used for a catkin project is a standard vanilla CMakeLists.txt file with a few additional constraints.

2.Is it related to a make file used for compiling C++ objects?

        Yes,a CMakeLists.txt file is related to building C++ projects, but it serves a different purpose compared to traditional Makefiles.

3.If yes then what is the difference between the two?

        While both CMakeLists.txt files and Makefiles are used for building C++ projects, CMake provides a more flexible and cross-platform approach to project configuration and generation of build files.

2. (Python & C++) Are you using CMakeList.txt for Python in ROS? Is there a executable object being created for Python?
1.Are you using CMakeList.txt for Python in ROS?

        No,but in ROS, CMakeLists.txt files are primarily used for building C++ code, but they can also be used to build certain types of Python code. While Python scripts themselves are not compiled into executable binaries, CMakeLists.txt files can include directives to handle Python-related tasks such as copying Python scripts to the appropriate locations in the ROS package.

2.Is there a executable object being created for Python?

        No, Python scripts are not compiled into executable objects in the same way as C++ code. Python is an interpreted language, which means that Python code is executed line by line by the Python interpreter at runtime.When you run a Python script, the interpreter reads the source code and translates it into bytecode, which is then executed by the Python virtual machine (PVM). This process happens dynamically without the need for pre-compilation into an executable object file.Therefore, in the context of Python in ROS or any other Python programming, there is no separate compilation step that produces an executable object file. Instead, the Python interpreter directly executes the source code of the script.

3. (Python & C++) In which directory would you run catkin make?

        Path in the workspace.

4. (Python & C++) The following commands were used in the tutorial:
       $ source / opt / ros / kinetic ( melodic )/ setup . bash
       $ source devel / setup . bash
Why do we need to source setup.bash? What does it do? Why do we have to different setup.bash files here and what is there difference?

        The environment variable (source devel/setup.bash) is set so that the system can find this workspace. The default Ubuntu terminal is bash. You need to set the ros environment variable in bash, preferably in the.bashrc directory in your home directory. So that when a system start to perform the source/opt/ros/kinetic/setup. The bash command, make the environment variables in the workspace can take effect, this system terminal can read ros command, perform the corresponding operation.

  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值