Ask Your Question

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

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

alvinhu gravatar image

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

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


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 image sr_corey  ( 2019-06-24 17:40:09 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-25 11:35:58 -0600

sr_corey gravatar image

For anyone still having this issue, check out

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-09-25 19:59:00 -0600

Seen: 154 times

Last updated: Sep 26 '17