Closed akshat209141 closed 3 months ago
MapView Component
This component, located at src/components/mapview.jsx
, is utilized to display a map with a pointer.
// mapView - method is responsible for displaying the map and a pointer
mapView(){
if(this.state.connected === true){
try {
this.viewer2 = new window.ROS2D.Viewer({
divID : 'nav',
width : 750,
height : 550
});
// eslint-disable-next-line
this.state.nav = window.NAV2D.OccupancyGridClientNav({
ros : this.state.ros,
rootObject : this.viewer2.scene,
viewer : this.viewer2,
serverName : '/move_base',
topic : "/map"
});
console.log("Nav setup complete")
} catch (error) {
console.log("Nav error");
console.log(error);
}
}
}
All the necessary libraries are included in public/index.html
in the head tag as follows:
<script src="./js/eventemitter2.min.js"></script>
<script src="./js/roslib.js"></script>
<script src="./js/ease1js.js"></script>
<script src="./js/mjpegcanvas.min.js"></script>
<script src="./js/ros2d.js"></script>
<script src="./js/nav2d.min.js"></script>
I am closing this issue now. Hope this will help!
Hey , your code does not contain that feature which you have shown in your video, the arrow representing the robot while we move the robot is not showing.