ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Base_Link, Map and Odom all static using ROS Navstack?

asked 2023-05-22 09:08:40 -0500

Yizu gravatar image

updated 2023-05-24 05:26:34 -0500

First time poster. Long time user.! Hoping for some guidance. Using Jetson nano running Ubuntu 18.04 + ROS Melodic. Im Connecting to the robot using a remote laptop. Have set up the networking to allow for rostopics to pub/sub both ways between the robot and the laptop.

Ive been following multiple tutorials on how to get Navstack working on a real robot, predominantly Automatic Addisons tutorial as i thought it was well written and straight forward... (https://automaticaddison.com/how-to-s...)

I've set up my navstack, using a BNO055 + encoder motors to count ticks etc. using an arduino as a drive controller to drive the wheels based on "cmd_vel" values. ...but im stuck.

When i launch my navigation stack, everything launches as i believe its supposed to. I can set an initial pose and my AMCL gets to work and localises the robot in the map and lines the laser scan to the walls on the map good enough. My issue starts when i set a goal pose. The path shows up so my planning seems to work and my robot moves IRL but not in RVIZ which causes my robot to either

  1. just go in a straight line as its being sent constant cmd_vel to reach the first pose in the path?
  2. oscillates to try and correct itself trying to get to the first pose.

I am under the impression that my issues are within some transform or odom not publishing correctly, causing my TF to stay in the same spot in RVIZ. My TF frames tree looks correct: map>odom>base_footprint>base_link and my rqt_graph looks okay and matches the one on the tutorial, only difference is tutorial has TrajectoryPlannerROS node and mine is using Navfn .

When my robot moves across the apartment where im testing, the laser scan moves on rviz because its on the robot that is moving across my kitchen), but the robot TF on rviz stays at initial pose. Ive been stuck for a bit. i even hit up the original tutorial poster but he left me on read. punk a$$ 8!tch. Any help would appreciated!

This is my launch file:

<launch>

  <!-- Transformation Configuration ... Setting Up the Relationships Between Coordinate Frames --> 
  <node pkg="tf" type="static_transform_publisher" name="robot_footprint_to_base_link_bc" args="0 0 0.05 0 0 0 base_footprint base_link 30" /> <!-- Transform between the base_footprint ("Robots shadow on the ground plane") and base_link ("The robots chassis") -->
  <node pkg="tf" type="static_transform_publisher" name="base_link_to_laser_bc" args="0.04 0 0.06 0 0 0 base_link laser 30" /> <!-- Between base_link ("The robots chassis") and laser (|The robots RPlidar") -->
  <node pkg="tf" type="static_transform_publisher" name="base_link_to_imu_bc" args="0.02 0.0 0.005 0 0 0 base_link imu 30" /> <!-- Between base_link ("The robots chassis") and imu (|The robots MPU-6050/GY521") -->

  <!-- map to odom will be provided by the AMCL -->
  <!-- <node pkg="tf" type="static_transform_publisher" name="map_to_odom" args="0 0 0 0 0 0 map odom 40" /> ...
(more)
edit retag flag offensive close merge delete

Comments

I've reformatted your post a little. It was a bit hard to read. Please try to format using code blocks (use the Pre-formatted text button to do that (ie: the one with 101010 on it).

I tried to post photos but i need points or something.

you need at least 10 karma points to do that, but please note: only post images when needed. Terminals and code are all text, so just do what you did: copy-paste and format as code.

(Ill post it here) image description

you can't really link to image like that. If these are screenshots of TF trees or RViz, then please attach them directly to your post. I've given you sufficient karma. For code/.launch files/etc: please see my earlier comment.

gvdhoorn gravatar image gvdhoorn  ( 2023-05-23 03:00:48 -0500 )edit

legend, thanks alot for the reformatting. i was a bit suspicious as to why it didnt look like opther posts ive seen. noted for next time! and thanks for the extra karma. ill post some screenshots of my rviz and TF tree to help others understand my issue a bit better cheers.

Yizu gravatar image Yizu  ( 2023-05-23 03:41:02 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-24 08:09:12 -0500

Per Edwardsson gravatar image

What node is responsible for the odom->base_footprint transform? That one is supposed to change whenever the robot moves. To do so, you need to have sensors which report movement somehow, like your encoders, and you need to figure out the movement based on that sensor data, with something like an EKF. Can you confirm that the fixed frame in your RViz window is map? If so, can you still see lidar points?

edit flag offensive delete link more

Comments

Hi Per, I can confirm that the Fixed Frame in my RVIZ window is indeed map. Lidar points are visible and updating.

As for the odom->base_footprint , i have an "Odom_Publisher" node that is responsible for converting wheel encoder ticks and turning them into an odometry message Quarternion or Euler and that publishes to a topic that is then collected by the "Robot_Pose_Ekf" node that uses EKF to fuse IMU and wheel encoder data to publish a combined odom.

Yizu gravatar image Yizu  ( 2023-05-24 09:15:45 -0500 )edit

Okay, it seems to me that this node is not doing its job. Can you confirm that the odom_publisher node data makes sense when you move the robot? If so, check if the robot_pose_ekf node can subscribe to the output of the odom_publisher.

Per Edwardsson gravatar image Per Edwardsson  ( 2023-05-25 03:08:30 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2023-05-22 09:08:40 -0500

Seen: 110 times

Last updated: May 24 '23