reiniscimurs / DRL-robot-navigation

Deep Reinforcement Learning for mobile robot navigation in ROS Gazebo simulator. Using Twin Delayed Deep Deterministic Policy Gradient (TD3) neural network, a robot learns to navigate to a random goal point in a simulated environment while avoiding obstacles.
MIT License
487 stars 97 forks source link

Scan rotating issue #56

Closed doyeon-danny closed 3 months ago

doyeon-danny commented 1 year ago

Hi, thank you for sharing your good project.

I am applying to change robot to Jackal and 2D laserscan. My scan data has been rotating and the robot cannot reach to goal position. Goal position is in the map's boundary, but laserscan data is going out of the boundary.

As I change robot,laser and code, I guess it is affected by

  1. difference of diff drive between Pioneer and Jackal

  2. Laserscan data I adjusted your velodyne_callback function.

  3. Jackal's different IMU which makes laser rotates.

scan-rotate scan-rotate2 Laserscan data is getting far from the main grid. I want to locate it on the right position.

I hope you can help me, Thank you.

reiniscimurs commented 1 year ago

Hi,

I am not sure if I get the issue here. Is it that the laser scan drifts over time?

In any case, it looks like something is off with your transforms. How did you replace the robot model? What steps did you take for that?

I am not quite getting the point 3. Is the laser scan somehow "tied" to the IMU positioning? What does your rqt_tf_tree look like?

doyeon-danny commented 1 year ago

Hi, First of all, I changed "pioneer3dx.gazebo.launch" to "jackal.gazebo.launch". I adjusted some codes to fit with Jackal model. Codes are below.

<launch>

  <arg name="robot_name" default="jackal" />
  <!-- <arg name="robot_position" default="-x -1.0 -y 5.0 -z 0.01" /> -->

    <!-- Load the URDF into the ROS Parameter Server -->
    <include file="$(find jackal_gazebo)/launch/spawn_jackal.launch">
      <arg name="x" value="-1.0" />
      <arg name="y" value="5.0" />
      <arg name="z" value="0.01" />
      <arg name="yaw" value="0" />
    </include>

    <include file="$(find jackal_navigation)/launch/include/move_base.launch" />
    <!-- <include file="$(find jackal_navigation)/launch/gmapping_demo.launch">
      <arg name="scan_topic"    value="dokuyo/scan" />
    </include> -->

  <node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
      <param name="publish_frequency" type="double" value="30.0"/>
  </node>

</launch>

and this is rqt_tf_graph.

drl_nav_tftree

I also changed velodyne_callback function liike below code. velodyne_env.py

    def velodyne_callback(self, v):
        self.velodyne_data = np.ones(self.environment_dim) * 10

        for i in range(len(v.ranges)):
            dist = v.ranges[i]
            # angle = dist + v.angle_min + v.angle_increment * i
            angle = v.angle_min + v.angle_increment * i
            beta = angle
            # beta = angle - np.pi/2.0

            for j in range(len(self.gaps)):
                # if self.gaps[j][0] <= beta < self.gaps[j][1]:
                #     self.velodyne_data[j] = min(self.velodyne_data[j], dist)
                #     break
                if 0.1 <= dist <= 30.0 and self.gaps[j][0] <= beta < self.gaps[j][1]:
                    self.velodyne_data[j] = min(self.velodyne_data[j], dist)
                    break

You can ignore number3(about IMU). I would not fully understand your proejct, so, there would be some problems.

zichengS1999 commented 6 months ago

Hi, thank you for sharing your good project.

I am applying to change robot to Jackal and 2D laserscan. My scan data has been rotating and the robot cannot reach to goal position. Goal position is in the map's boundary, but laserscan data is going out of the boundary.

As I change robot,laser and code, I guess it is affected by

  1. difference of diff drive between Pioneer and Jackal
  2. Laserscan data I adjusted your velodyne_callback function.
  3. Jackal's different IMU which makes laser rotates.

scan-rotate scan-rotate2 Laserscan data is getting far from the main grid. I want to locate it on the right position.

I hope you can help me, Thank you.

Hello, I also have the same issue. Have you managed to resolve it?