Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why divide the lase #12

Open
ymq1117 opened this issue Oct 18, 2023 · 9 comments
Open

why divide the lase #12

ymq1117 opened this issue Oct 18, 2023 · 9 comments

Comments

@ymq1117
Copy link

ymq1117 commented Oct 18, 2023

image
Here, after dividing the readings into 19 groups, why divide the laser state by 10? If I still use simulated laser in Project drl-robot-navigation to divide 360 readings into 20 groups, do I still need to divide by 10?

@reiniscimurs
Copy link
Owner

Hi,
We normalize the laser value in range [0, 1].
First, we cap each laser value at 10 meters, then we divide it into groups, then we normalize the range. So even with more laser values, you would divide it by 10 to normalize the values.

The value would have to be the same as here:

GDAE/Code/GDAM_env.py

Lines 188 to 189 in fc793ed

laser_in[laser_in == inf] = 10
laser_in[laser_in > 10] = 10

@ymq1117
Copy link
Author

ymq1117 commented Oct 21, 2023

Thanks for your time and patience.
When I launch slam_toolbox by running "roslaunch slam_toolbox online_sync.launch", I want it to subscribe to "r1/front_laser/scan“ like the picture below. (The picture is from another issue)
ab13c7bc74e52e079c840d4dcf0004b
But it subscribes to Topic "/scan" by default. I searched online but couldn't find where should I change it.
Could you tell me where to modify?

@reiniscimurs
Copy link
Owner

Hi,

have you updated your slam_toolbox configs with the topic names that you want to use?
For example:
https://github.com/SteveMacenski/slam_toolbox/blob/ros2/config/mapper_params_online_sync.yaml#L16

You would have to modify this for the method of SLAM toolbox that you are using.

@ymq1117
Copy link
Author

ymq1117 commented Oct 21, 2023

Thanks so much for your time and patience!
After I launch move_base and slam_toolbox and run GADM.py, here is the output: This warning keeps coming up
5e04103f00f9a7d921e38329cd59258
And this error appears after I execute the command "Ctrl+c".
dfdc0be3638e1f75da01cd0e33acabb
tf2.LookupException: "map" passed to lookupTransform argument target_frame does not exist.
Do you have any idea?

@reiniscimurs
Copy link
Owner

reiniscimurs commented Oct 21, 2023

I do not recall where the map would be set and where the connection would be made. Perhaps in your costmap configs.

You could check if you have connection between your map topic and base_link in the qrt.

Additionally you could try publishing connection directly in your launch file and seeing if that works:

<node pkg="tf" type="static_transform_publisher" name="map_to_odom"
args="0.0 -0.0 0.0 3.14 0.0 0.0 map base_link  200" />

@ymq1117
Copy link
Author

ymq1117 commented Oct 22, 2023

Thank you for your help and patience !
I'm sorry I'm not familiar with ros. This is my launch file and yaml configuration file for move_base and the topics I modified in GDAM_env.py, and also the laser input. These are all the modifications I've done to the original project.
There are still many problems with the output.
c425f230f6116ac8f467956949667c2

bf29da8631d78c06296be276f57b923
1cc33ae9a6e03eb081447b53998eea1
d5cf7d4dfeeeacf9dccfe26e6ef2a98
6625484220917ffbc046f13fcabcf0b
fbe579d1a912bde1419e557c646084e
250d31e760e0c7179f6f22fba3221c5

graph
frame
1697981488874
1697981549441
271d185a9af8958c7897a91029bebf5
Could your give me some suggestion to run it correctly? The "global frame" in the move_base configuration yaml files should be odom or map?

@reiniscimurs
Copy link
Owner

Hi, so I see a couple of things here.

You probably want to use map as global_frame in your costmaps. You currently do not have a link from odom to base_link (hence the error). See if using map help there. Then probably publishing it manually should not be required.

I am a little confused about where do the laser readings come from? And what are the topic names of your sensors? I see there is a velodyne lidar in the image, but that is not part of sensor suite in the repository. Are you merging the DRL repository with this one? In any case, you should check the topic names that you are trying to launch. For instance, I see you are trying to subscribe to r1/odom topic, but in the rqt tree it is /odom topic.

@ymq1117
Copy link
Author

ymq1117 commented Oct 24, 2023

Yes I'm merging DRL repository with this one.
It seems that there is no need to manually publish the map to base link transformation, after removing "", my tf tree looks right now:
534e81c82c486aa15c7c570475d2b0b.RobotModel status in rviz is also no error. Now, are there any errors with this tf tree? If the "odom" in the tree should be "/r1/odom", where should I change it?

If I set the global_frame in global costmap.yaml here as "odom“:
image
The output is like this:
9526bcad81a97ed7b6211e47e75e9ec
If I set it as "map",
The output is same as before after I execute the command "Ctrl+c". Like this:
image

@reiniscimurs
Copy link
Owner

In the DRL training scenario we spawn a virtual robot with namespace r1. This is not the case in this repo, as an actual real robot was used, so no robot was spawned and no namespace was used. I think you will have to align the naming of the topics for the program to understand what is happening.

You could try looking at rostopic list at runtime and try to see what topics are published and at what names.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants