ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.12k stars 9.7k forks source link

Is there any differences between turning on a module via Dreamview and terminal? #11545

Closed lh315936716 closed 4 years ago

daohu527 commented 4 years ago

They don't have much difference.

1. dreamview

Actually "Dreamview" starts the module by calling backend command, you can find and modify the dag file in modules/dreamview/conf/hmi_modes , for example "mkz_standard_debug.pb.txt".

cyber_modules {
  key: "Canbus"
  value: {
    dag_files: "/apollo/modules/canbus/dag/canbus.dag"
  }
}
cyber_modules {
  key: "Control"
  value: {
    dag_files: "/apollo/modules/control/dag/control.dag"
  }
}
...

2. terminal

For example, you can modify the dag file in modules/control/launch/control.launch, and use

cyber_launch start /apollo/modules/control/launch/control.launch

to start the control module.

lh315936716 commented 4 years ago

They don't have much difference.

1. dreamview

Actually "Dreamview" starts the module by calling backend command, you can find and modify the dag file in modules/dreamview/conf/hmi_modes , for example "mkz_standard_debug.pb.txt".

cyber_modules {
  key: "Canbus"
  value: {
    dag_files: "/apollo/modules/canbus/dag/canbus.dag"
  }
}
cyber_modules {
  key: "Control"
  value: {
    dag_files: "/apollo/modules/control/dag/control.dag"
  }
}
...

2. terminal

For example, you can modify the dag file in modules/control/launch/control.launch, and use

cyber_launch start /apollo/modules/control/launch/control.launch

to start the control module.

Thank you. So Both Dreamview and cyber_launch call the .dag file? Is that also the same when calling "mainboard xxx.dag"?

daohu527 commented 4 years ago
  1. Actually cyber_launch use mainboard to start the dag file. cyber_launch can start multiple dags at once, but mainboard can only start one. The lauch file will contain multiple dags.

    <cyber>
    <module>
        <name>driver</name>
        <dag_conf>driver.dag</dag_conf>
        <process_name></process_name>
        <exception_handler>exit</exception_handler>
    </module>
    <module>
        <name>perception</name>
        <dag_conf>perception.dag</dag_conf>
        <process_name></process_name>
        <exception_handler>respawn</exception_handler>
    </module>
    <module>
        <name>planning</name>
        <dag_conf>planning.dag</dag_conf>
        <process_name></process_name>
    </module>
    </cyber>
  2. You can find the implementation of cyber_launch in “cyber/tools/cyber_launch/cyber_launch", which parse the launch file and then use mainboard to start dags.

lh315936716 commented 4 years ago
  1. Actually cyber_launch use mainboard to start the dag file. cyber_launch can start multiple dags at once, but mainboard can only start one. The lauch file will contain multiple dags.
<cyber>
    <module>
        <name>driver</name>
        <dag_conf>driver.dag</dag_conf>
        <process_name></process_name>
        <exception_handler>exit</exception_handler>
    </module>
    <module>
        <name>perception</name>
        <dag_conf>perception.dag</dag_conf>
        <process_name></process_name>
        <exception_handler>respawn</exception_handler>
    </module>
    <module>
        <name>planning</name>
        <dag_conf>planning.dag</dag_conf>
        <process_name></process_name>
    </module>
</cyber>
  1. You can find the implementation of cyber_launch in “cyber/tools/cyber_launch/cyber_launch", which parse the launch file and then use mainboard to start dags.

Thank you!

sjiang2018 commented 4 years ago

Hi @lh315936716, hope our answer resolved your question. We will close the issue for now. If you have any additional question, please feel free to open a new issue. Our engineer team are more than happy to help that.

Thank you for supporting Apollo!