osrf / mbzirc

Simulator for the MBZIRC Maritime Grand Challenge
Apache License 2.0
71 stars 46 forks source link

Simulation environment does not terminate #176

Open fjdk99 opened 2 years ago

fjdk99 commented 2 years ago

Hello sir,

sometimes after terminating the simulator (ros2 launch mbzirc_ign competition.launch.py), the simulation environment does not terminate. The IMU output remains and it also remains after the next execution of the simulation.

We have restarted the computer, but the simulation still did not terminate and continues to publish IMU data.

How can we force quit the simulation and start a new simulation?

`ros2 topic list
/clock
/mbzirc/phase
/mbzirc/run_clock
/mbzirc/score
/mbzirc/target/stream/status
/parameter_events
/rosout
/tf
/tf_static
/usv/imu/data
/usv/left/thrust/cmd_thrust
/usv/left/thrust/joint/cmd_pos
/usv/mbzirc/target/stream/report
/usv/mbzirc/target/stream/start
/usv/pose
/usv/pose_static
/usv/right/thrust/cmd_thrust
/usv/right/thrust/joint/cmd_pos
/usv/rx
/usv/tx`

ROS2 topic echo /usv/imu/data after executing a new simulation (the imu output of both simulation are published)

---
header:
  stamp:
    sec: 3
    nanosec: 136000000
  frame_id: usv/base_link/imu_sensor
orientation:
  x: -0.0056755307511875235
  y: 0.0010024945562267312
  z: 2.627127831869407e-05
  w: 0.9999833911946623
orientation_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
angular_velocity:
  x: 0.014
  y: 0.0045000000000000005
  z: 0.01375
angular_velocity_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
linear_acceleration:
  x: 0.0
  y: -0.15
  z: 9.725
linear_acceleration_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
---
header:
  stamp:
    sec: 2754
    nanosec: 244000000
  frame_id: usv/base_link/imu_sensor
orientation:
  x: 0.0005549074972481079
  y: -0.002239549322588234
  z: 0.9562263095949062
  w: -0.2926190720629942
orientation_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
angular_velocity:
  x: 0.0125
  y: 0.00025
  z: 0.00025
angular_velocity_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
linear_acceleration:
  x: 0.0
  y: -0.06
  z: 9.81
linear_acceleration_covariance:
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
- 0.0
iche033 commented 2 years ago

We have restarted the computer, but the simulation still did not terminate and continues to publish IMU data.

oh that's weird since you have restarted the computer I wouldn't expect anything running. Do you have multiple machines in the same local network running simulation? Perhaps another computer is running simulation and publishing data? If that's the case, you can set ROS_DOMAIN_ID (e.g. export ROS_DOMAIN_ID=2) to a different number to prevent one machine from listening to ros2 topics from another machine.

There are also example commands in the Troubleshooting page on killing simulation processes if that helps.