Field-Robotics-Lab / dave

Project DAVE
Apache License 2.0
221 stars 69 forks source link

Following DAVE install/build wiki does not lead to successful example simulation execution on fresh builds #159

Closed BOSS-CC closed 2 years ago

BOSS-CC commented 2 years ago

On a fresh build of a DAVE system running Ubuntu 20.04 and ROS Noetic:

roslaunch dave_demo_launch dave_demo.launch

launches a simulation environment within Gazebo, however the simulated vehicle appears to idle brokenly within the environment.

Along the same lines, regarding https://github.com/Field-Robotics-Lab/dave/wiki/Glider-Models: (dated 24 Sept 2020)

roslaunch uuv_dave gliders_demo.launch paused:=true

returns:

RLException: [gliders_demo.launch] is neither a launch file in package [uuv_dave] nor is [uuv_dave] a launch file name

and in fact uuv_dave appears to only contain:

boss@boss-ThinkPad-P53:~/uuv_ws$ roslaunch uuv_dave joy_thrusterop.launch record_demo.launch smilodon_standalone.launch

Thus I'm uncertain how to follow the wiki to explore the DAVE examples, and am unable to determine if I have failed a successful installation/build of DAVE on my system because things are not where they should be or if the development of DAVE (& ROS) has outpaced the updating of the wiki because things have been simply moved elsewhere but are still fully functional.

This issue has been replicated on another fresh system by a more experienced ROS user than I.

woensug-choi commented 2 years ago

Sorry for the lag between the source code and the wiki. The correct command for gliders would be roslaunch dave_demo_launch dave_gliders_visual_demo.launch paused:=true. I've updated the wiki.

What do you mean by

the simulated vehicle appears to idle brokenly within the environment.

when launching the dave_demo.launch??

BOSS-CC commented 2 years ago

Thanks @woensug-choi, using your updated roslaunch details I'm able to successfully load a simulation containing a Slocum glider mid-water. However, when I Play the simulation, the vehicle remains stationary whilst pitching up and down rapidly and then eventually stops/breaks/crashes with the terminal window showing:

gzserver: /home/boss/uuv_ws/src/uuv_simulator/uuv_gazebo_plugins/uuv_gazebo_plugins/src/UnderwaterObjectPlugin.cc:209: virtual void gazebo::UnderwaterObjectPlugin::Update(const gazebo::common::UpdateInfo&): Assertion `(!std::isnan(linearAccel) && !std::isnan(angularAccel))&&("Linear or angular accelerations are invalid.")' failed.
Aborted (core dumped)
[gazebo-2] process has died [pid 5017, exit code 134, cmd /opt/ros/noetic/lib/gazebo_ros/gzserver -u --verbose -e ode /home/boss/uuv_ws/src/dave/models/dave_worlds/worlds/dave_ocean_waves.world __name:=gazebo __log:=/home/boss/.ros/log/cbde49fe-385a-11ec-b0c3-259f317ed9d9/gazebo-2.log].

Perhaps some issue with the Slocum model - inertia related? Making guesses...

Regarding the "brokenly idle" behaviour of the dave_demo.launch simulation, digging through the scrollback in the terminal window during launch reveals a few missing pieces and dead processes:

ModuleNotFoundError: No module named 'urdf_parser_py'
[rexrov/oberon7/kinematics_service-17] process has died [pid 6087, exit code 1, cmd /home/boss/uuv_ws/devel/lib/uuv_manipulators_kinematics/kinematics_service.py __name:=kinematics_service
AccelerationControllerNode: initializing node
[rexrov/oberon7/joint_position_controller_oberon7-18] process has died [pid 6088, exit code 1, cmd /home/boss/uuv_ws/devel/lib/uuv_manipulators_control/joint_position_controller.py joy:=/rexrov/joy __name:=joint_position_controller_oberon7
[ INFO] [1635472935.268425625]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[rexrov/oberon7/gripper_controller_oberon7-16] process has died [pid 6086, exit code 1, cmd /home/boss/uuv_ws/devel/lib/uuv_manipulators_control/gripper_controller.py joy:=/rexrov/joy __name:=gripper_controller_oberon7

whilst the simulation itself shows the vehicle model with thrusters rotating (some at different speeds) but otherwise not performing any actions/movement. Note that I do not have a joystick connected to the system at all - I don't know if that's a pre-requisite for this particular simulation.

woensug-choi commented 2 years ago

@BOSS-CC Yes, the inertial is the problem. It is the correct guess. Changing the line https://github.com/Field-Robotics-Lab/dave/blob/c6e3d923760e787ee9d7c49c67e767f1457779a8/urdf/robots/glider_description/urdf/glider_slocum.xacro#L59 to a more realistic inertia values will solve the unstableness of the physics engine behind it.

I've made a new branch so that you can test. It's slocum_example branch and the new launch command with only slocum glider with new inertial values is 'roslaunch dave_demo_launch dave_glider_slocum_demo.launch paused:=true`.

But, the launch file included in the dave repository callback the uuv_underwater_object_ros_plugin library which is inherited from uuv_simulator. It does not include any physical parameters of the glider kinematics characteristics (moving mass and buoyancy pump). In order to utilize those, you may need to use hybrid_glider_whoi repo. It includes source code for kinematics_ros_plugin library.

And yes, you need a joystick to control the vehicle. Unless you design your own control script. Otherwise, it will stay still.

What are you trying to do?

woensug-choi commented 2 years ago

Closing this issue has been without any response for 20 days. I hope things worked out for you. If not, comment here, and I will revive this.