tasks.json 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. {
  2. "version": "2.0.0",
  3. "tasks": [
  4. {
  5. "label": "编译轮椅状态机",
  6. "type": "shell",
  7. "command": "bash",
  8. "args": [
  9. "-c",
  10. "cd ${workspaceFolder} && source /opt/ros/humble/setup.bash && colcon build --packages-select wheelchair_state_machine --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS='-O0 -g -Wall'"
  11. ],
  12. "group": {
  13. "kind": "build",
  14. "isDefault": true
  15. },
  16. "problemMatcher": [
  17. "$gcc"
  18. ],
  19. "presentation": {
  20. "reveal": "always",
  21. "panel": "new",
  22. "clear": true
  23. },
  24. "options": {
  25. "cwd": "${workspaceFolder}"
  26. }
  27. },
  28. {
  29. "label": "清理并重新编译",
  30. "type": "shell",
  31. "command": "bash",
  32. "args": [
  33. "-c",
  34. "cd ${workspaceFolder} && rm -rf build/ install/ log/ && source /opt/ros/humble/setup.bash && colcon build --packages-select wheelchair_state_machine --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS='-O0 -g -Wall'"
  35. ],
  36. "group": "build",
  37. "problemMatcher": ["$gcc"],
  38. "presentation": {
  39. "reveal": "always",
  40. "panel": "new",
  41. "clear": true
  42. }
  43. },
  44. {
  45. "label": "运行节点",
  46. "type": "shell",
  47. "command": "bash",
  48. "args": [
  49. "-c",
  50. "cd ${workspaceFolder} && source install/setup.bash && ros2 run wheelchair_state_machine wheelchair_state_machine_node"
  51. ],
  52. "dependsOn": ["编译轮椅状态机"],
  53. "problemMatcher": [],
  54. "presentation": {
  55. "reveal": "always",
  56. "panel": "new"
  57. }
  58. },
  59. {
  60. "label": "运行节点(带参数)",
  61. "type": "shell",
  62. "command": "bash",
  63. "args": [
  64. "-c",
  65. "cd ${workspaceFolder} && source install/setup.bash && ros2 run wheelchair_state_machine wheelchair_state_machine_node --ros-args -p low_battery_threshold:=25.0 -p critical_battery_threshold:=15.0"
  66. ],
  67. "dependsOn": ["编译轮椅状态机"],
  68. "problemMatcher": [],
  69. "presentation": {
  70. "reveal": "always",
  71. "panel": "new"
  72. }
  73. },
  74. {
  75. "label": "查看话题列表",
  76. "type": "shell",
  77. "command": "bash",
  78. "args": [
  79. "-c",
  80. "cd ${workspaceFolder} && source install/setup.bash && ros2 topic list"
  81. ],
  82. "problemMatcher": [],
  83. "presentation": {
  84. "reveal": "always",
  85. "panel": "new"
  86. }
  87. },
  88. {
  89. "label": "查看电池状态话题",
  90. "type": "shell",
  91. "command": "bash",
  92. "args": [
  93. "-c",
  94. "cd ${workspaceFolder} && source install/setup.bash && ros2 topic echo /battery_state"
  95. ],
  96. "problemMatcher": [],
  97. "presentation": {
  98. "reveal": "always",
  99. "panel": "new"
  100. }
  101. }
  102. ]
  103. }