waypoints: reconstruir o pacote perdido como RECONSTRUCAO DECLARADA
O gitlink src/waypoints (sha 115553cfa8c2ace122414ac5a9b235cd2e225693) apontava
para codigo que nao existe em nenhum remoto conhecido (Gitea, GitHub, maquina,
web) e que o autor ja nao tem. O resultado era concreto: `rosrun waypoints
waypoints_server`, que guide.txt manda correr, nao resolvia num clone limpo, e a
unica saida honesta era reconstruir ou documentar a falta. O autor autorizou a
reconstrucao ("ja nao tenho waypoints, se conseguires criar um, agradecia"),
por isso o gitlink e substituido por conteudo dentro do repositorio
(`git rm --cached src/waypoints` + ficheiros commitados), escrito a partir das
pistas que sobreviveram:
* guide.txt: nome do pacote (`waypoints`) e do executavel
(`waypoints_server`), sem argumentos - o unico contrato documentado;
* p3dx_navigation.rviz: as classes `waypoints/waypointPanel` (painel) e
`waypoints/Waypoints` (ferramenta, `Topic: waypoint`) provam que o original
tambem trazia plugins rviz em C++ e que o topico `waypoint` era usado.
O que fica e uma RECONSTRUCAO DECLARADA, nao o trabalho original: Python (o
autor pediu legibilidade, e um no C++ com interface adivinhada nao poderia ser
compilado nem testado aqui), um servidor de waypoints conservador
(`geometry_msgs/PoseStamped` em `waypoint` -> `geometry_msgs/PoseArray`
latched em `waypoints`), e um README dentro do pacote que diz o que e certo
(o nome do no), o que e inferido (topicos, tipos, parametros), que os plugins
rviz do original NAO foram reproduzidos e que quem reutilizar isto deve
confirmar o interface antes de confiar nele.
Os documentos passam a dizer isto: README.md (seccao do waypoints e linha da
tabela de licencas: GPLv3, como o resto do repo), tests/known-gaps.txt (a
lacuna deixa de ser o codigo e passa a ser o ORIGINAL, e o `darknet_ros` do
guide.txt continua por resolver) e tests/run.sh + tests/negative.sh (8
verificacoes novas, incluindo as negativas em copias mktemp: apagar o no,
tirar o package.xml, tirar o +x, renomear o no, estragar o Python, tirar a
declaracao e voltar a fazer gitlink). O .gitmodules nao muda: so `rosaria`
continua a ser submodulo, e como `waypoints` era o ultimo gitlink sem
mapeamento, `git submodule status` deixa de se queixar e o clone limpo deixa de
trazer um diretorio vazio.
O que isto NAO prova, e fica dito: nao houve ROS neste ambiente, portanto nao
houve catkin_make nem rosrun. So a estrutura, o nome do no e a sintaxe
(python3 -m py_compile) foram verificados.
This commit is contained in:
+44
-1
@@ -5,7 +5,8 @@
|
||||
# Each case copies the working tree into a temporary directory, breaks exactly
|
||||
# one thing THERE, and asserts that tests/run.sh then fails with the expected
|
||||
# check id. Nothing in the real repository is modified: every mutation happens
|
||||
# in the throwaway copy.
|
||||
# in the throwaway copy (one of them even commits there, to turn src/waypoints
|
||||
# back into a gitlink).
|
||||
#
|
||||
# Usage: tests/negative.sh
|
||||
# Exit status: 0 = every case behaved as expected.
|
||||
@@ -53,6 +54,41 @@ mut_add_orphan_entry() {
|
||||
# a declared package that lost a required file
|
||||
mut_break_package() { mv src/robot/CMakeLists.txt src/robot/CMakeLists.txt.hidden; }
|
||||
|
||||
# --- the waypoints package (the declared reconstruction) -------------------
|
||||
|
||||
# the node that guide.txt runs is gone
|
||||
mut_drop_waypoints_node() { rm -f src/waypoints/scripts/waypoints_server; }
|
||||
|
||||
# the package lost its package.xml
|
||||
mut_drop_waypoints_package_xml() { mv src/waypoints/package.xml src/waypoints/package.xml.hidden; }
|
||||
|
||||
# the node is not executable any more, so rosrun would not run it
|
||||
mut_waypoints_node_not_executable() { chmod -x src/waypoints/scripts/waypoints_server; }
|
||||
|
||||
# the node no longer initialises itself under the name guide.txt runs
|
||||
mut_waypoints_node_renamed() {
|
||||
sed -i "s/init_node('waypoints_server')/init_node('something_else')/" \
|
||||
src/waypoints/scripts/waypoints_server
|
||||
}
|
||||
|
||||
# the node stops being valid Python
|
||||
mut_waypoints_syntax_error() {
|
||||
printf '\ndef broken(:\n' >> src/waypoints/scripts/waypoints_server
|
||||
}
|
||||
|
||||
# the reconstruction stops declaring itself
|
||||
mut_waypoints_no_declaration() { rm -f src/waypoints/README.md; }
|
||||
|
||||
# the fix is undone: src/waypoints goes back to being a gitlink with no content
|
||||
mut_waypoints_back_to_gitlink() {
|
||||
rm -rf src/waypoints
|
||||
git rm -r --cached --quiet src/waypoints >/dev/null 2>&1
|
||||
git update-index --add --cacheinfo \
|
||||
160000,115553cfa8c2ace122414ac5a9b235cd2e225693,src/waypoints
|
||||
git -c user.name=negative -c user.email=negative@invalid commit \
|
||||
--quiet -m "back to a gitlink" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
# --- runner ---------------------------------------------------------------
|
||||
|
||||
case_expect() {
|
||||
@@ -100,6 +136,13 @@ case_expect mut_drop_rosaria_entry gitlink-undeclared
|
||||
case_expect mut_hide_gitmodules gitmodules-missing
|
||||
case_expect mut_add_orphan_entry gitmodules-orphan
|
||||
case_expect mut_break_package cmakelists-missing
|
||||
case_expect mut_drop_waypoints_node waypoints-node-present
|
||||
case_expect mut_drop_waypoints_package_xml waypoints-package-xml
|
||||
case_expect mut_waypoints_node_not_executable waypoints-node-executable
|
||||
case_expect mut_waypoints_node_renamed waypoints-node-name
|
||||
case_expect mut_waypoints_syntax_error waypoints-python-syntax
|
||||
case_expect mut_waypoints_no_declaration waypoints-declared
|
||||
case_expect mut_waypoints_back_to_gitlink waypoints-still-gitlink
|
||||
|
||||
echo
|
||||
if [ "$fails" -eq 0 ]; then
|
||||
|
||||
Reference in New Issue
Block a user