You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here is some code used greatly inspired by the ones that can be found on classical tutorial.
//création du viewer de l urdf
const viewer = new ROS3D.Viewer({
divID: id_div,
width: this.state.largeur,
height: this.state.hauteur,
antialias: true
});
this.viewer = viewer;
//ajout de la grille, il est possible de changer la couleur, la taille des cellules etc.
viewer.addObject(new ROS3D.Grid());
//initialisation du TF
var tfClient = new ROSLIB.TFClient({
ros: this.ros,
angularThres: 0.01,
transThres: 0.01,
rate: 1,
fixedFrame: 'base_link', // frame qui va servir de référence pour l'image
});
// objet permettant de lire sur un topic ROS de type PointCloud2
// pour l'afficher sur le panel du robot 3D
let newPointCloud = new ROS3D.PointCloud2({
ros: this.ros,
tfClient: this.tfClient,
// il eciste plusieurs topic de type PointCloud2
topic: /rtabmap/cloud_map,
max_pts: 500000,
rootObject: viewer.scene,
material: {size: 0.06},
colormap: this.colormap,
});
// Ne pas oublier dec changer l'URL pour exporter une version de production
new ROS3D.UrdfClient({
ros: this.ros,
tfClient: this.tfClient,
path: URL_DEV, // url to ros
rootObject: viewer.scene,
loader : new ColladaLoader() // cela permet d'analyser les meshes pour les afficher
});
here is the colormap function :
colormap = (x) => {
let rgb;
// line 54279 de ROS3d nous renvoie une valeur qui n'est pas un nombre parfois et qui explique le manque de couleur
if(isNaN(x)) {
rgb = {
r: 1,
g: 1,
b: 1,
a: 0,
};
} else {
this._floatColor[0] = x;
const intColor = new Int32Array(this._floatColor.buffer);
const colorInt = intColor[0];
rgb = {
r: this._rgb_lut[(colorInt >> 16) & 0xff],
g: this._rgb_lut[(colorInt >> 8) & 0xff],
b: this._rgb_lut[(colorInt) & 0xff],
a: 1.0
};
}
return rgb;
}
Expected Behavior
non numeric Value sent by ros3d.Point.getColor should then be transparent.
Actual Behavior
non numeric Value sent by ros3d.Point.getColor should are filled with a color that have are fully white.
The text was updated successfully, but these errors were encountered:
Description
Steps To Reproduce
here is some code used greatly inspired by the ones that can be found on classical tutorial.
here is the colormap function :
Expected Behavior
non numeric Value sent by ros3d.Point.getColor should then be transparent.
Actual Behavior
non numeric Value sent by ros3d.Point.getColor should are filled with a color that have are fully white.
The text was updated successfully, but these errors were encountered: