how to change ros(map) coordinate system to html5 canvas coordinate system

asked 2017-09-25 19:59:00 -0500

alvinhu gravatar image

updated 2017-09-26 15:36:21 -0500

jayess gravatar image

We want to design a robot web monitor of robot location. We has been built the indoor map through the ros and generate a map picture, the file pf yaml parameters are as follows:

[resolution: 0.050000
origin: [-24.45000, -28.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196]

, according to the html5 canvas will always show the location on the indoor map. But we do not know how to change ros(map) coordinate system to html5 canvas coordinate system. Hope that experienced people can give me some ideas or algorithms, thank you.

edit retag flag offensive close merge delete

Comments

Did you ever figure this out? I am attempting to do the same thing. I want to create my own custom map component so we can do more custom actions with the map, such as creating travel lanes with user input on the map. The problem is that I don't know how to convert the ROS coordinates to canvas coordinates and can't find any information about how the robot_pose_publisher goes about doing so.

sr_corey gravatar imagesr_corey ( 2019-06-24 17:40:09 -0500 )edit

For anyone still having this issue, check out http://answers.ros.org/question/20552....

To paraphrase: In the case where the origin of /map and your grid 0,0 are the same and there is no rotation between the two, you need a pixel to real world units (meters) scale factor. OccupancyGrid has resolution in meters/cell. So pose.x / resolution = cell_x.

sr_corey gravatar imagesr_corey ( 2019-06-25 11:35:58 -0500 )edit