I am following the free live class based on Duckietown : ROS Developers LIVE-Class #30
The UI shown in the video is very different then the present studio i.e. there is no way to launch the main.launch directly from the UI. So, we have to launch it manually.
I did following steps.
1.roslaunch duckietown_gazebo main.launch → this launches gazebo simulation with the duckieworld
2.roslaunch duckietown_gazebo spawn_duckbot.launch → this spawns the duckiebot robot .
3.as shown in the video I gave following commands to move the robot.
rostopic pub -1 /robot1/cmd_vel geometry_msgs/Twist “linear:
x: 0.1
y: 0.0
z: 0.0
angular:
x: 0.0
y: 0.0
z: 0.5”
However, the robot is not moving whereas in the video the robot moves if we publish to cmd_vel.
One interesting thing is that if I spawn the same robot in some other world and publish to cmd_vel then the robot moves.
why is not moving in the duckietown simulation? Please let me know?
The system has been updated many times since then, although we kept the ROS distro configuration. You did it correctly to run the simulation manually.
I’m trying to reproduce the same environment but here I could not have the simulation running.
I have the fresh rosject copied but when I try to run the command
roslaunch duckietown_gazebo main.launch
I had some errors related to gazebo libs. Did you install something previously?
[Err] [SystemPaths.cc:429] File or path does not exist["/home/user/.gazebo/models/apartment/meshes/model.dae"]
[Err] [MeshShape.cc:67] No mesh specified
[Err] [Plugin.hh:165] Failed to load plugin libanimated_box.so: libanimated_box.so: cannot open shared object file: No such file or directory
[Err] [Plugin.hh:165] Failed to load plugin libanimated_box_south.so: libanimated_box_south.so: cannot open shared object file: No such file or directory
Please, let me know if you had something extra installed so I can reproduce exactly the same environment as you have.
note: in the video its shown with distro=kinetic and in the video the author has mentioned that we don’t need to build i.e. run as is. But its not happening for distro=noetic.
I have made some following changes to rosject i.e. earlier it was using the distro=kinetic. The problem with kinetic was that I was not getting the menu in the gazebo.
.roslaunch duckietown_gazebo main.launch
So to try different option I edited the distro to noetic. But when I try to do a roslaunch i.e.
.roslaunch duckietown_gazebo main.launch
I am getting the following error i.e.
RLException: [main.launch] is neither a launch file in package [duckietown_gazebo] nor is [duckietown_gazebo] a launch file nameThe traceback for the exception was written to the log file
then I did:
user:~$ source /home/user/simulation_ws/devel/setup.bash
~$ roslaunch duckietown_gazebo main.launch
bash: roslaunch: command not found
I am getting the error as : bash: roslaunch: command not found
Thank you for the details. I tried from here the same environment, switching from kinetic to noetic.
Remember to source ~/simulation_ws/devel/setup.bash, and here I could have the launch file run
Although still had the issue with the libs. I’m investigating it
Please, run echo $ROS_PACKAGE_PATH before the roslaunch so we can check your environment is properly configured
If you refer my first message regarding this discussion. Even before you have mentioned.I gave the same path i.e. source /home/user/simulation_ws/devel/setup.bash
But still I am getting the following error without the build. I have also provided the rosject link which I am using along with $ROS_PACKAGE_PATH before and after the roslaunch:
user:~$ echo $ROS_PACKAGE_PATH
/home/simulations/public_sim_ws/src:/opt/ros/noetic/share
user:~$ source ~/simulation_ws/devel/setup.bash
user:~$ echo $ROS_PACKAGE_PATH
/home/simulations/public_sim_ws/src:/opt/ros/noetic/share
user:~$ roslaunch
bash: roslaunch: command not found
What do you mean by “without the build” ?
We can run launch files without building them, but the build and devel folders must be present to be sourced, they will create the paths to the installation folders of ROS and all its libraries.Do you have such folders in the simulation_ws?
I tried the rosject you send to me with the same changes and still got the simulation launched like I’ve shown, but with some errors.
I need some time to understand it, I’ll get back with more details after debugging it.
By the way, are you running it inside ROSDS or in another environment?
As I mentioned earlier I am using the project as is without any modification i.e. both the devel and build folders are present both in simultaion_ws and catkin_ws (I have not done any kind of build or changed anything)
Again, as mentioned earlier if I use distro=kinetic then the project works. But I don’t get the menu in gazebo.
To get the menu in gazebo I have changed the distro=noetic. But the project doesn’t works even with errors as mentioned above I am getting the error : roslaunch command not found(so bascially even if I am setting the path to source ~/simulation_ws/devel/setup.bash. I am still get the error as roslaunch command not found)
Please do your research, fix the issue and then get back to me. Its almost a week now and still there is no solution.
Let me break into 2 parts the steps I followed.
The 1st part is compiling the environment properly using kinetic, since this project was designed for that distro.
Kinetic
1 - Remove build and devel folders from catkin_ws and simulation_ws
2 - Source /home/simulations/public_sim_ws/devel/setup.bash, it contains other dependencies of our platform
3 - Modify the files below, because they are referencing the package duckietown_msgs when it is not included in our system anymore, and not being used in the packages we are compiling
thanks for the above solution. I will try and get back to you if there is any problem.
I have one more question regarding the gazebo environment. Please find here attached fig 1 and fig 2.
Question:
what is the way I can find the position of x,y coordinates in the gazebo simulation.
For example consider the attached fig 1 what is the way I can find the x,y position of red dot?
also, consider the attached fig 2 what is the way I can find the x,y position of yellow dot or for matter x,y coordinates position for any point in gazebo world?
Finally, for simpler simulations, like the one you attached in the 1st image, you can also use the simulator coordinate frames. By convention, we have Blue for z-axis, red for x-axis and green for y-axis. The ground is divided in squares of 1 meter
It is basically counting the squares in the ground, taking into account the frames of the world.
Do you have the Gazebo world reference frame in the center of the ground?
It should be the same you we have for the duckietown simulation, at the center you can see the long blue and green lines.
It’s not the best way as I mentioned before, we can do it for small worlds. The best approach would be using rviz or even the gazebo plugin.
Unfortunately I don’t have an example for this plugin. As I mentioned, this is recommended in gazebo forum, but I haven’t tried it.
Th additional steps are the implementation mentioned in the original post, using the Dominoes example to get the mouse movement and position in the simulation
Hi @vibs, unfortunately I can’t it since it’s a bit out of the scope of the platform, our courses and material created.
The suggested post leads you to get the example of the time widget and the code of another plugin that reads the data of the camera and world to show the position information in the widget.
Please, let me know if you have any other issue regarding to the live class mentioned before.
Hi marco when i launch main.launch file after watching to this video i have this in terminal :
$ roslaunch duckietown_gazebo main.launch
… logging to /home/mohamedali/.ros/log/92db1680-cdd3-11ee-a360-51ff6577cb1d/roslaunch-mohamedali-Lenovo-ideapad-330-15IKB-23140.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
process[gazebo-1]: started with pid [23155]
process[gazebo_gui-2]: started with pid [23159]
[ INFO] [1708209052.111267040]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1708209052.116423141]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting…
[ INFO] [1708209052.402686687]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1708209052.410322349]: waitForService: Service [/gazebo_gui/set_physics_properties] has not been advertised, waiting…
Service [/House 1/shininess] is not valid.
Service [/House 2/shininess] is not valid.
Service [/House 3/shininess] is not valid.
Service [/Fast Food/shininess] is not valid.
Service [/Gas Station/shininess] is not valid.
[ INFO] [1708209053.901454089]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1708209053.981014622]: Physics dynamic reconfigure ready. and the gui is not completed haw can i solve this issue please