Open Ethan0207 opened 3 months ago
Hi,
This project uses multi-channel Lidar. We squash the 3D measurements into 2D to create a single dimensional vector for input into the TD3 network. Direct multi-channel input is also possible in theory. But this project does not support that. Here, only single dimension inputs are supported out of the box.
OK, thank you for your reply. It is helpful for me.
Hi,
These days I changed the lidar. But I met a problem. The lidar had changed successfully, but the car model could not move. I checked my plugin and I synced my robot namespace. Could you give me some suggestions?
this is my modified env.py file.
this is main xacro file.
this is main plugin file
Hi,
Please provide more information about the issue. What do you mean it cannot move? Is there an error or does the network not produce an output? How have you debugged the code? How do you check that the data from your lidar is correct?
Quick note is that in your callback you are using a point_cloud2 function but your message type is PointCloud instead of PointCloud2. But in general, these kinds of changes are outside the scope of this repository and I would not have the time to investigate such in depth changes. Good luck!
Hi,
Thank you for your reply. Firstly, the model can not move. It just means when I trained it, nothing happened. But the topic could be subscribed, so I guessed the problem is with the car motion plugin. Therefore, I checked it and I synced my robot namespace. But now, I find a strange thing. When I change my robot namespace to "/", it is normal and the model can move. I adjusted the namespace earlier because it reported the following error.
Traceback (most recent call last):
File "train_velodyne_td3.py", line 346, in
Hi, I unified the sensor_msgs/PointCloud, but it still reported the following error. Traceback (most recent call last): File "train_velodyne_td3.py", line 346, in next_state, reward, done, target = env.step(a_in) File "/home/team/DRL-robot-navigation-scout/TD3/velodyne_env.py", line 196, in step self.odom_x = self.last_odom.pose.pose.position.x AttributeError: 'NoneType' object has no attribute 'pose' I didn't understand this error. Can you help me explain it? And faced with such mistakes, how to solve?
Add: I synced my robot namespace from"/" to "/scout". It is ok. But the model can not move. Based on your answer, if I want to check if it has an output, how can I do? Could you give me some suggestions?
Hi, Thank you for your reply. Firstly, the model can not move. It just means when I trained it, nothing happened. But the topic could be subscribed, so I guessed the problem is with the car motion plugin. Therefore, I checked it and I synced my robot namespace. But now, I find a strange thing. When I change my robot namespace to "/", it is normal and the model can move. I adjusted the namespace earlier because it reported the following error. Traceback (most recent call last): File "train_velodyne_td3.py", line 346, in next_state, reward, done, target = env.step(a_in) File "/home/team/DRL-robot-navigation-scout/TD3/velodyne_env.py", line 196, in step self.odom_x = self.last_odom.pose.pose.position.x AttributeError: 'NoneType' object has no attribute 'pose' So I synced my robot namespace from"/" to "/scout". Now, I adjust the namespace to "/". It is normal. Secondly, based on your answer, if I want to check if it has an output, how can I do? Finally, about the lidar, it is good suggestion, I will try to synced the message type.
Hi, I unified the sensor_msgs/PointCloud, but it still reported the following error. Traceback (most recent call last): File "train_velodyne_td3.py", line 346, in next_state, reward, done, target = env.step(a_in) File "/home/team/DRL-robot-navigation-scout/TD3/velodyne_env.py", line 196, in step self.odom_x = self.last_odom.pose.pose.position.x AttributeError: 'NoneType' object has no attribute 'pose' I didn't understand this error. Can you help me explain it? And faced with such mistakes, how to solve?
Hi! Just fixed this problem and found someone has encountered the same problem. In velodyne_env.py there's a "self.last_odom" which is init with "None", if you change "self.last_odom = None" into "self.last_odom = Odometry()" the attribute error will be solved. (At least for me) :)
Hi, I unified the sensor_msgs/PointCloud, but it still reported the following error. Traceback (most recent call last): File "train_velodyne_td3.py", line 346, in next_state, reward, done, target = env.step(a_in) File "/home/team/DRL-robot-navigation-scout/TD3/velodyne_env.py", line 196, in step self.odom_x = self.last_odom.pose.pose.position.x AttributeError: 'NoneType' object has no attribute 'pose' I didn't understand this error. Can you help me explain it? And faced with such mistakes, how to solve?
Hi! Just fixed this problem and found someone has encountered the same problem. In velodyne_env.py there's a "self.last_odom" which is init with "None", if you change "self.last_odom = None" into "self.last_odom = Odometry()" the attribute error will be solved. (At least for me) :)
Hi, thank you for your reply. I have solved the problem. Could you tell me what the reason is?
Hi,
Initializing with Odometry() will solve the symptom but not the issue. The reason why this error appears is that there has been no odometry published to the topic that you subscribed to. So the callback does not get triggered and value for self.last_odom
does not get updated before you call it. We initialize with None
so that we accidentally would not be using some random values in odometry that would be difficult to trace. If you initialize with Odometry()
you will get some input already in self.last_odom
from the very beginning with some dummy numbers, but if the odometry callback will never be triggered, your self.last_odom
will never be updated and the odoetry information will be wrong.
I assume this issue arises for you because of one of two reasons:
rostopic echo
to see their values. For instance, you are hardcoding a prefix /scout to some topics in your plugin but not for odom. But you still have prefix /scout in your odometry subscriber. I would suggest double checking that.Hi,
Thank you for your reply. It is extremely helpful for me. I have another question.
From this picture, I can't understand how to setting the filtering parameter? For example, the filtering parameter of Turtlebot waffle is -0.072. How did you calculate 0.072?
It is simply the height from the ground at which you have set your sensor (plus some buffer value)
Hi, This project uses a single-line Lidar. I would like to ask if multi-line Lidar is feasible.