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
488 stars 98 forks source link

Changing robot model #47

Closed reiniscimurs closed 1 year ago

reiniscimurs commented 1 year ago
          Hi Reinis,

How are you?

So finally mobile robot right now works pretty well.

As you remember I told that I want to change robot model itself and I couldn't find distinguishable place where robot model dynamics and kinematics are defined. I understand that it is within Gazebo environment but still did not find explicit location. I am new with Ros and Gazebo.

So where is it located and where I can change it, thank you beforehand!?

Originally posted by @Darkhan92 in https://github.com/reiniscimurs/DRL-robot-navigation/issues/44#issuecomment-1396446243

reiniscimurs commented 1 year ago

@Darkhan92

Robot that is used in the simulation is set in: https://github.com/reiniscimurs/DRL-robot-navigation/blob/c8321b22339115c983fb1d6575ba48ca8b57025a/TD3/assets/multi_robot_scenario.launch#L9

a launch file of the robot is referenced there. To see the call to the robot model and following sequence of the robot setup, it might be easier to look into the Noetic-Turtlebot branch. You will have to create a call to the launch file of your robot from your robot package.

catkin_ws/src/turtlebot3/turtlebot3_bringup/launch/turtlebot3_model.launch In the robot launch file you can specify the xacro file of your robot description: https://github.com/reiniscimurs/DRL-robot-navigation/blob/c8321b22339115c983fb1d6575ba48ca8b57025a/catkin_ws/src/turtlebot3/turtlebot3_bringup/launch/turtlebot3_model.launch#L7

Then you can start the required nodes. To spawn the robot in Gazebo: https://github.com/reiniscimurs/DRL-robot-navigation/blob/c8321b22339115c983fb1d6575ba48ca8b57025a/catkin_ws/src/turtlebot3/turtlebot3_bringup/launch/turtlebot3_model.launch#L10

Robot state publisher: https://github.com/reiniscimurs/DRL-robot-navigation/blob/c8321b22339115c983fb1d6575ba48ca8b57025a/catkin_ws/src/turtlebot3/turtlebot3_bringup/launch/turtlebot3_model.launch#L12

Publish the joint state node: https://github.com/reiniscimurs/DRL-robot-navigation/blob/c8321b22339115c983fb1d6575ba48ca8b57025a/catkin_ws/src/turtlebot3/turtlebot3_bringup/launch/turtlebot3_model.launch#L17

If you have the xacro file and urdf files of your robot, this change should not be too difficult.

Darkhan92 commented 1 year ago

Thank you for the comment. I found this models. Soon I look for that I will tell you the results

Darkhan92 commented 1 year ago

Hello again, how are you?

So I have changed the model of the robot and for example wheel size. In Rviz, it shows as truncated and tilted. But in the gazebo, it shows as floating in the air. How to make that in Gazebo also changes the size of the wheel. Are stl files is involved in visualization?

reiniscimurs commented 1 year ago

Hi,

Yes, stl files are responsible for the visualization of each element of the robot. Changing the wheel size and distance in the description will effectively describe the kinematics, but will not update the stl files. You should change them or update them accordingly. Also, check if differential drive plugin values are consistent with your new wheel sizes.

Darkhan92 commented 1 year ago

Hi, how are you Reinis?

I am worked a lot to make dynamic wheel size changing model with xacro. But still struggling with that. Is it possible to make links visible in Gazebo and in Rviz the links using only xacro description without involving mesh STL files? For only wheel for example? Is there possibility to obtain wheel attributes through python?

I know it is not directly related to your model initialization, but just wondering if you experience this kind of manipulation with robot model. Thank you

reiniscimurs commented 1 year ago

Hi,

Sorry, I am not an expert on model creation and maintenance. This seems like a rather complex issue and I do not think I can help you with this task.

Darkhan92 commented 1 year ago

Ok. Thank you for reply.