⚲
Projet
Général
Profil
Connexion
S'enregistrer
Accueil
Projets
Aide
Recherche
:
Polytech Ge Sous Traitance
Tous les projets
Polytech Projets Ge
»
Polytech Ge Sous Traitance
Aperçu
Activité
Roadmap
Demandes
Gantt
Calendrier
Annonces
Documents
Wiki
Fichiers
Dépôt
Télécharger (607 octets)
Feature #14794
» OccupancyGrid.py
Anonyme, 25/11/2022 17:13
#!/usr/bin/env python
import
rospy
from
nav_msgs.msg
import
OccupancyGrid
import
numpy
as
np
from
numpy
import
asarray
from
numpy
import
savetxt
msg
=
OccupancyGrid
()
def
point
(
msg
):
#global A, M
M
=
np
.
matrix
(
msg
.
data
)
#print('taille de la matrice : ', M.shape) # nb ligne et colonne
A
=
M
.
reshape
(
1984
,
1984
)
#print('taille de la matrice : ', A.shape)
#print(A)
savetxt
(
'data.csv'
,
A
,
delimiter
=
','
)
rospy
.
init_node
(
'map'
)
rospy
.
Subscriber
(
"/map"
,
OccupancyGrid
,
point
)
rate
=
rospy
.
Rate
(
10
)
while
not
rospy
.
is_shutdown
():
rate
.
sleep
()
« Précédent
1
2
Suivant »
(2-2/2)
Chargement...