Set goal for navigation in webpage

Hi everyone, I want to set goals for navigation by creating topic /move_base_simple/goal in main.js, but it didn’t work:
Screenshot from 2021-09-17 09-01-29

Screenshot from 2021-09-17 09-05-49

How can I solve it?Screenshot from 2021-09-17 09-05-49

Hi @nguyenphucvuongcdt ,

There are 2 things you can debug

  • Is rosbridge connected?
    Make sure the websocket is connected and the messages are getting there using the developer tools of your browser

  • Is the message arriving to the topic?
    Use the shell ad check rostopic echo /move_base_simple/goal topic. Is there a message arriving?

rosbridge was connected, I could move robot by button. I also check /move_base_simple/goal topic but no messase received.

Let’s check other parts of your env. Can you try setting the goal by publishing to /move_base_simple/goal using the shell?

1. Testing the action server

rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped {pose: { position: { x: 5, y: 5 }}}

Keep watching the topic using echo and check if the action server works with that.

2. Testing rosbridge messages

If the action server works, check if rosbridge sends the message properly. Open your developer tools, click over rosbridge connection and take a screenshot of the messages being sent (like the screenshot below):

Thank for replying. I launched follow to your instruction but still not working:

  1. Test the action server:
    I used rostopic pub /move_base_simple/goal but there is an error. I don’t know why it’s happen. I set goal by button in rviz working well.

I tested rosbrigde message:
/cmd_vel worked well but others topic didn’t:

Rosbridge do not send the message if the messageType does not match.

Can you disable the other messages and check only the websocket message when you advertise the publisher to the goal?

About RViz, it is important to make sure it is configured properly, since rosbridge messages should not affect it. It is better to solve one thing before trying the communication from rosbridge

I think I find the problem. move_base_simple/goal is a subcribed topic not published topic. So, I can’t set goal by using this topic.

I understand. In that case, is there a topic that your action server is subscribing?

You may use this topic to send messages to