Giter Club home page Giter Club logo

beamng-ros-integration's Introduction

BeamNG ROS Integration

About

This repository contains packages to support the interoperability between BeamNG.tech and ROS. BeamNG.tech is a driving simulation platform, suitable for commercial and academic use. Free licenses are available for non-commercial and academic use. Inquiries can be made through our registration form. For inquiries regarding commercial use, contact us at [email protected].

Table of Contents

Documentation

Features

As of now the BeamNG ROS integration supports one package for the remote control of the simulation platform and one package for the control of a driving agent. A third package manages custom messages.

Prerequirements

For using the BeamNG ROS integration, a BeamNG.tech build and a python environment with BeamNGpy installed are required.

Note that BeamNG.tech only runs on Window, although Linux support is on its way. That means that BeamNG.tech needs to run on a separate Windows machine, or that ROS needs to run on on WSL.

The BeamNG ROS integration is compatible with the ROS 1 distributions Melodic Morenia and Noetic Ninjemys.

Getting Started

To use this project, a basic knowledge of the BeamNG.tech simulator and the BeamNGpy is neccessary. We recommend to familiarize yourself first with BeamNGpy to get a basic understanding of the platform before using the BeamNG ROS Integration.

After setting up BeamNG.tech and BeamNGpy with a python environment, the simulation needs to be started through BeamNGpy or through the excutable file exe.

Method 1: Using beamngpy

To start the simulator via Python and beamngpy, follow these steps - Open your command prompt. - Execute the following Python code:

from beamngpy import BeamNGpy, Scenario, Vehicle
bng = BeamNGpy('localhost', 64256)  # Initialize the BeamNGpy instance to connect to the simulator
bng.open(listen_ip='*')  # Open the simulator with an open listening IP

This method initializes the BeamNGpy instance, connecting to the BeamNG.Tech simulator, and then opens the simulator to listen for incoming connections.

Method 2: Using Command Prompt

Alternatively, you can start the simulator directly from the command prompt: - Open your command prompt. - Navigate to your simulator's directory. - Paste and execute the following command

Bin64\BeamNG.tech.x64.exe -rport 64256 -nosteam -lua registerCoreModule('tech/techCore')

The ROS packages from this repository need to be added and build in your catkin workspace. See the ROS tutorials for more information on how to set up a catkin workspace.

A node connecting ROS to the simulation can then be started with the help of the control.launch file in the beamng_control package through the command:

roslaunch beamng_control control.launch

It needs to be configured to contain the correct IP address of the machine hosting the simulation. Using it will start up a node that connects to the simulation and starts up a scenario as defined in the beamng_control/config/simple_scenario.json. Other scenario specifications are available in the same directory.

ROS Demo GIF

Compatibility

Running the BeamNG ROS integration requires three individual software components, here is a list of compatible versions.

BeamNG.tech BeamNGpy BeamNG ROS Integration
0.31 1.28 0.4.1
0.30 1.27.1 0.4
0.29 1.26.1 0.3
0.28 1.26 0.2.1
0.27 1.25.1 0.2
0.26 1.24 0.1.1
0.25 1.23.1 0.1

Troubleshooting

This section lists common issues with BeamNG ROS Integration in particular. Since this library is closely tied to BeamNG.tech and thus BeamNG.drive, it is also recommended to consult the documentation on BeamNG.drive here:

https://documentation.beamng.com/

Contributions

We always welcome user contributions, be sure to check out our contribution guidelines first, before starting your work.

beamng-ros-integration's People

Contributors

abdelrahmanelsaidelsawy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beamng-ros-integration's Issues

Some sensors do not work

I am running beamng on a windows 11 box and connecting to it across ethernet from my ubuntu 20.04 box.

Env details:
Python==3.7.13
Beamngpy==1.26
Beamng ros integration==0.1.3
Beamngtech==0.28.2.0

I can successfully run and visualize with rviz the default beamn_control example launch. However, when I try and use LiDAR or cameras I am unable to successfully launch a the scenario with sensors from ROS.

Digging into the code it looks like the definitions used in the sensor getters are different to the ones in the beamngpy api.

Take lidar for example

class Lidar:
    """
    An interactive, automated LiDAR sensor, which produces regular LiDAR point clouds, ready for further processing.
    This sensor can be attached to a vehicle, or can be fixed to a position in space. The dir and up parameters are used to set the local coordinate system.
    A requested update rate can be provided, to tell the simulator how often to read measurements for this sensor. If a negative value is provided, the sensor
    will not update automatically at all. However, ad-hoc polling requests can be sent at any time, even for non-updating sensors.

    Args:
        name: A unique name for this LiDAR sensor.
        bng: The BeamNGpy instance, with which to communicate to the simulation.
        vehicle: The vehicle to which this sensor should be attached, if any.
        requested_update_time: The time which should pass between sensor reading updates, in seconds. This is just a suggestion to the manager.
        update_priority: The priority which the sensor should ask for new readings. lowest -> 0, highest -> 1.
        pos: (X, Y, Z) coordinate triplet specifying the position of the sensor, in world space.
        dir: (X, Y, Z) Coordinate triplet specifying the forward direction of the sensor.
        up: (X, Y, Z) Coordinate triplet specifying the up direction of the sensor.
        vertical_resolution: The vertical resolution of this LiDAR sensor.
        vertical_angle: The vertical angle of this LiDAR sensor, in degrees.
        rays_per_second: The number of LiDAR rays per second which this sensor should emit.
        frequency: The frequency of this LiDAR sensor.
        horizontal_angle: The horizontal angle of this LiDAR sensor.
        max_distance: The maximum distance which this LiDAR sensor will detect, in metres.
        is_using_shared_memory: A flag which indicates if we should use shared memory to send/recieve the sensor readings data.
        is_visualised: A flag which indicates if this LiDAR sensor should appear visualised or not.
        is_annotated: A flag which indicates if this LiDAR sensor should return annotation data instead of distance data.
        is_static: A flag which indicates whether this sensor should be static (fixed position), or attached to a vehicle.
        is_snapping_desired: A flag which indicates whether or not to snap the sensor to the nearest vehicle triangle (not used for static sensors).
        is_force_inside_triangle: A flag which indicates if the sensor should be forced inside the nearest vehicle triangle (not used for static sensors).

compared with the getters args

        lidar = bng_sensors.Lidar(offset=position,
                                  direction=direction,
                                  vres=vertical_resolution,
                                  vangle=vertical_angle,
                                  max_dist=max_distance,
                                  shmem=False,
                                  **spec)

Many of the args are incorrect for example, 'offset' does not appear in the api but rather 'pos'.

I updated these and tried to run again but got then find that 'bng' and 'name' are missing.

I attempted to hand the bng instance (I think) created in the BeamNGBridge line 38 through to the Lidar and created a dummy name. With this roslaunch is able to run past this getter but now the game instance on my windows box crashes. I have attached the error log here.

843cd52a-4b9a-488b-8cf8-a20cbe72d39a.zip

I have not attempted to patch the cameras or extensively tested other sensors at this stage.

I am curious how I can use these sensors when there seems to be a mismatch?

error in beamng_agent node: KeyError: 'beamng'

ubuntu_20@DESKTOP-HKDK1FO:~/catkin_ws$ roslaunch beamng_agent example.launch
... logging to /home/ubuntu_20/.ros/log/f5ac04d6-5549-11ec-a125-00155d7eb7cc/roslaunch-DESKTOP-HKDK1FO-25213.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.

started roslaunch server http://localhost:35383/

SUMMARY

PARAMETERS

  • /rosdistro: noetic
  • /rosversion: 1.15.13

NODES
/
control (beamng_agent/control.py)

auto-starting new master
process[master]: started with pid [25221]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to f5ac04d6-5549-11ec-a125-00155d7eb7cc
process[rosout-1]: started with pid [25231]
started core service [/rosout]
process[control-2]: started with pid [25234]
Traceback (most recent call last):
File "/home/ubuntu_20/catkin_ws/devel/lib/beamng_agent/control.py", line 15, in
exec(compile(fh.read(), python_script, 'exec'), context)
File "/home/ubuntu_20/catkin_ws/src/beamng-ros-integration/beamng_agent/scripts/control.py", line 82, in
main()
File "/home/ubuntu_20/catkin_ws/src/beamng-ros-integration/beamng_agent/scripts/control.py", line 75, in main
VehicleControl(argv[1])
File "/home/ubuntu_20/catkin_ws/src/beamng-ros-integration/beamng_agent/scripts/control.py", line 19, in init
params = rospy.get_param("beamng")
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/client.py", line 467, in get_param
return _param_server[param_name] #MasterProxy does all the magic for us
File "/opt/ros/noetic/lib/python3/dist-packages/rospy/msproxy.py", line 123, in getitem
raise KeyError(key)
KeyError: 'beamng'
[control-2] process has died [pid 25234, exit code 1, cmd /home/ubuntu_20/catkin_ws/devel/lib/beamng_agent/control.py ego_vehicle __name:=control __log:=/home/ubuntu_20/.ros/log/f5ac04d6-5549-11ec-a125-00155d7eb7cc/control-2.log].
log file: /home/ubuntu_20/.ros/log/f5ac04d6-5549-11ec-a125-00155d7eb7cc/control-2*.log
^C[rosout-1] killing on exit
^C[master] killing on exit
^Cshutting down processing monitor...
... shutting down processing monitor complete
done

after loading scenario from beamng_control.launch, it doesn't have drive system, i have to reload the vehicle/scenario or reposition/clone the vehicle to be able to drive the vehicle

i loaded a scenario using Beamng_control example.launch, but the scnerio doen't start, so i have to manually click on start button of BeamNG.Drive game, After that the vehicle don't move by keyboard keys, so i have to press CTR+R to reload the vehicle

i used the following script to load the BeamNG.Drive Game

import time 
from beamngpy import BeamNGpy, Scenario, Vehicle

bng = BeamNGpy('localhost', 64256) 
bng.open()

while True:
    time.sleep(5)

then BeamNG.Drive consol shows the followng error :


000.247|I|Paths|User path: C:\Users\USER\AppData\Local\BeamNG.drive\
000.978|I|SFXFMODProvider::init|SFXFMODProvider - FMOD API version: 2.1.16
002.125|I|SFXSystem::initChannels|SFXSystem initChannels called.....
002.216|I|SFXFMODDevice::_init|SFXFMODDevice::_init() - Setting max Vorbis codecs to 32
002.217|I|SFXFMODDevice::_init|SFXFMODDevice::_init() - Setting max FADPCM codecs to 32
002.218|I|SFXFMODDevice::_init|SFXFMODDevice::_init() - Setting idle sample pool size to 384MB
002.305|I|GELua.|============== Game Engine Lua VM started ==============
002.478|I|GELua.core_activityManager.|Loaded 11 condition types from 3 files.
002.489|I|GELua.gameplay_missions_missions.|Loaded 2 procedural Mission Generators from 2 files.
002.494|I|Paths|User path: C:\Users\USER\AppData\Local\BeamNG.drive\
007.264|I|GELua.pri143.409|I|GELua.util_researchGE.ResearchGE|Accepted new client: 10.140.0.27/64256
143.742|I|GELua.util_researchGE.ResearchGE|Loading scenario: /levels/GridMap/scenarios/test.json
143.905|I|GELua.util_researchGE.ResearchGE|Scenario found...
144.652|I|GELua.levelLoading|*** loading level: levels/gridmap/info.json
144.654|I|GELua.levelLoading|*** Loading init took: 0.185 s
146.066|I|GELua.levelLoading|*** Loaded datablocks in 1.411 s
146.347|I|GELua.levelLoading|*** Loaded materials in 0.282 s
146.350|I|LoadingManager|starting to load objects. Displaying items above 10 ms
146.499|I|LoadingManager::loadLevelJsonObjects|* loading json took 0.147 s
146.501|I|LoadingManager::loadLevelJsonObjects|* ordering json took 0.002 s
146.503|I|LoadingManager| ===== Base       ===================================
146.575|I|LoadingManager|    LevelInfo            [1    ] in 0.070 s | 0.070 s/item
146.609|I|LoadingManager|    CameraBookmark       [11   ] in 0.013 s | 0.001 s/item
146.612|I|LoadingManager|                              total 0.107 s
146.614|I|LoadingManager| ===== Terrain    ===================================
147.177|I|LoadingManager|    TerrainBlock         [1    ] in 0.561 s | 0.561 s/item
147.179|I|LoadingManager|                              total 0.563 s
147.180|I|LoadingManager| ===== Environment ===================================
147.247|I|LoadingManager|    CloudLayer           [2    ] in 0.066 s | 0.033 s/item
147.275|I|LoadingManager|    ScatterSky           [1    ] in 0.026 s | 0.026 s/item
147.369|I|LoadingManager|    WaterBlock           [5    ] in 0.091 s | 0.018 s/item
147.561|I|LoadingManager|    GroundCover          [2    ] in 0.188 s | 0.094 s/item
147.564|I|LoadingManager|                              total 0.382 s
147.565|I|LoadingManager| ===== Forest     ===================================
147.877|I|Forest::reloadData|Read 2538 forest items split into 32 different types
149.799|I|LoadingManager|    Forest               [1    ] in 2.232 s | 2.232 s/item
149.801|I|LoadingManager|                              total 2.234 s
149.803|I|LoadingManager| ===== Meshes     ===================================
151.790|I|LoadingManager|    TSStatic             [867  ] in 1.986 s | 0.002 s/item
151.793|I|LoadingManager|                              total 1.989 s
151.794|I|LoadingManager| ===== Prefabs    ===================================
151.796|I|LoadingManager|                              total 0.000 s
151.797|I|LoadingManager| ===== Roads      ===================================
151.990|I|LoadingManager|    DecalRoad            [75   ] in 0.191 s | 0.003 s/item
151.994|I|LoadingManager|                              total 0.196 s
151.997|I|LoadingManager| ===== Audio      ===================================
151.999|I|LoadingManager|                              total 0.000 s
152.001|I|LoadingManager| ===== Other      ===================================
152.003|I|LoadingManager|                              total 0.001 s
152.773|I|SceneStaticManagerRender::_onObjectsReady|*** Built static data in 0.766s
152.775|I|LoadingManager::loadLevelJsonObjects|* loading took 6.274 s
152.781|I|GELua.levelLoading|*** Level loaded: /levels/gridmap/info.json
152.782|I|GELua.levelLoading|*** Loaded objects in 6.434 s
152.785|I|GELua.levelLoading|*** Loaded ai.map in 0.003 s
152.818|I|GELua.levelLoading|*** Loaded decals in 0.033 s
152.820|I|BeamNGPhysicsPlugin::enableSimulation|RELOADING COLLISION
152.897|I|BeamNGPhysicsPlugin::reload|*** generated physics collision in 0.076s
152.955|I|libbeamng.engine.staticCollision|*** Loaded Static Collision, containing 270591 tris, in 0.053 s
152.959|I|BeamNGPhysicsPlugin::reload|*** reloaded physics in 0.138s
152.961|I|GELua.levelLoading|*** Started physics in 0.143 s
152.974|I|GELua.levelLoading|*** Loaded player and camera in 0.013 s
153.007|E|translate|unable to find translation for key 'test'. Default: 'test'
153.011|W|ConsoleTypeTypeColorF::setData|TypeColorF() - Invalid single argument of 'None' could not be interpreted as a stock color name.  Using default.
153.014|W|StockColor::colorF|Could not find stock color name 'None', defaulting to 'White'
153.016|W|ConsoleTypeTypeColorF::setData|TypeColorF() - Invalid single argument of 'None' could not be interpreted as a stock color name.  Using default.
153.018|W|StockColor::colorF|Could not find stock color name 'None', defaulting to 'White'
153.021|W|ConsoleTypeTypeColorF::setData|TypeColorF() - Invalid single argument of 'None' could not be interpreted as a stock color name.  Using default.
153.023|W|StockColor::colorF|Could not find stock color name 'None', defaulting to 'White'
153.029|I|BeamNGVehicle::spawnObject|Spawning object 'etk800' with default config
169.139|E|GELua.scenario_scenarios.scenarios|Prefab: test already exist in level
169.141|I|BeamNGPhysicsPlugin::enableSimulation|RELOADING COLLISION
169.238|I|BeamNGPhysicsPlugin::reload|*** generated physics collision in 0.095s
169.240|I|BeamNGPhysicsPlugin::reload|*** reloaded physics in 0.097s
169.409|I|GELua.levelLoading|*** Loaded everything in 24.941 s
169.489|I|libbeamng.engine.staticCollision|*** Loaded Static Collision, containing 270591 tris, in 0.041 s
171.999|I|GELua.gameplay_missions_missions.|Loaded 200 total missions: 58 from files, 142 from generators.
174.170|I|GELua.main|Player #0 vehicle switched from: nil to: id 9011 (/vehicles/etk800/)
188.439|I|GELua.scenario_waypoints.waypoints|initialise called....
188.459|I|GELua.scenario_waypoints.waypoints|No lapconfig found or lapconfig empty. Not initializing waypoints system
189.112|I|GELua.util_researchGE.ResearchGE|New vehicle connection: 9011, 54632
189.195|E|GameEngineLua:Exception|/lua/common/luaBinding.lua:51: bad argument #1 to 'rawget' (table expected, got nil)
=============== Stack Traceback >> START >>
(1)  C function 'function: 0x01b1b459b6a8'
(2) global C function 'rawget'
(3) Lua metamethod '__index' at file '/lua/common/luaBinding.lua:51'
  Local variables:
  t = table: 0x01b1ea7caf80  {__index:function: 0x01b1e9ffae68, __newindex:function: 0x01b1e9ffaec8, getStaticColDebugEnabled:function: 0x01b1ea7d79e8 (more...)}
  k = string: "Annotation"
  mt = table: 0x01b1ea7caf80  {__index:function: 0x01b1e9ffae68, __newindex:function: 0x01b1e9ffaec8, getStaticColDebugEnabled:function: 0x01b1ea7d79e8 (more...)}
  res = nil
  origgetters = nil
(4) Lua local 'handler' at line 833 of chunk 'lua/ge/extensions//util/researchGE.lua'
  Local variables:
  skt = tcp{client}: 000001B1A955E0A0
  msg = table: 0x01b1c7e98bf8  {type:EngineFlags, flags:table: 0x01b1c7e98998}
  flags = table: 0x01b1c7e98998  {lidar:true, annotations:true}
  (*temporary) = table: 0x01b1ea7caf80  {__index:function: 0x01b1e9ffae68, __newindex:function: 0x01b1e9ffaec8, getStaticColDebugEnabled:function: 0x01b1ea7d79e8 (more...)}
  (*temporary) = table: 0x01b1c7e98bf8  {type:EngineFlags, flags:table: 0x01b1c7e98998}
  (*temporary) = number: 3
  (*temporary) = number: 2
  (*temporary) = number: 6.95141e-310
  (*temporary) = number: 9.2077e-312
(5) Lua field 'checkMessages' at line 113 of chunk 'lua/common/utils/researchCommunication.lua'
  Local variables:
  E = table: 0x01b1a41a1720  {handleCreateCube:function: 0x01b1eb07e470, notifyUI:function: 0x01b1eae43920 (more...)}
  clients = table: 0x01b1a9792858  {1:tcp{client}: 000001B1A97E2368, 2:tcp{client}: 000001B1A955E0A0}
  message = table: 0x01b1c7e98bf8  {type:EngineFlags, flags:table: 0x01b1c7e98998}
  err = nil
  readable = table: 0x01b1c56b8eb8  {1:tcp{client}: 000001B1A955E0A0, tcp{client}: 000001B1A955E0A0:1}
  writable = table: 0x01b1c5990698  {1:tcp{client}: 000001B1A97E2368, 2:tcp{client}: 000001B1A955E0A0, tcp{client}: 000001B1A97E2368:1 (more...)}
  error = nil
  ret = boolean: true
  (for index) = number: 1
  (for limit) = number: 1
  (for step) = number: 1
  i = number: 1
  skt = tcp{client}: 000001B1A955E0A0
  msgType = string: "handleEngineFlags"
  handler = Lua function '?' (defined at line 830 of chunk lua/ge/extensions//util/researchGE.lua)
(6) Lua local 'func' at line 163 of chunk 'lua/ge/extensions//util/researchGE.lua'
  Local variables:
  dt = number: 0.434086
  obsoleteFuncIndices = table: 0x01b1b7cc0478  {}
(7) Lua field 'hook' at line 654 of chunk 'lua/common/extensions.lua'
  Local variables:
  funcName = string: "onPreRender"
  funcList = table: 0x01b1d43fad50  {1:function: 0x01b1ead05b58, 2:function: 0x01b1eafb4338, 3:function: 0x01b1ead94908 (more...)}
  (for generator) = C function: builtin#6
  (for state) = table: 0x01b1d43fad50  {1:function: 0x01b1ead05b58, 2:function: 0x01b1eafb4338, 3:function: 0x01b1ead94908 (more...)}
  (for control) = number: 1
  _ = number: 1
  func = Lua function '?' (defined at line 102 of chunk lua/ge/extensions//util/researchGE.lua)
(8) Lua function 'luaPreRender' at file '/lua/ge/main.lua:302' (best guess)
  Local variables:
  dtReal = number: 0.434086
  dtSim = number: 0.05
  dtRaw = number: 0.0921748
  updateUIData = boolean: true
--------------- << END <<



<img width="960" alt="BNG_not_working" src="https://user-images.githubusercontent.com/94268081/149770630-67f1a570-b496-4724-aabe-d75cb8cb4224.PNG">


Rostest fail

i was testing the bridge package be running catkin_make run_tests_beamng_control, the result as shown below

`
ubuntu@DESKTOP-PUKHVO6:~/catkin_ws$ catkin_make run_tests_beamng_control
Base path: /home/ubuntu/catkin_ws
Source space: /home/ubuntu/catkin_ws/src
Build space: /home/ubuntu/catkin_ws/build
Devel space: /home/ubuntu/catkin_ws/devel
Install space: /home/ubuntu/catkin_ws/install

Running command: "make cmake_check_build_system" in "/home/ubuntu/catkin_ws/build"

Running command: "make run_tests_beamng_control -j8 -l8" in "/home/ubuntu/catkin_ws/build"

-- run_tests.py: execute commands
/usr/bin/python3 /opt/ros/noetic/share/rostest/cmake/../../../bin/rostest --pkgdir=/home/ubuntu/catkin_ws/src/beamng-ros-integration/beamng_control --package=beamng_control --results-filename test_topics.xml --results-base-dir "/home/ubuntu/catkin_ws/build/test_results" /home/ubuntu/catkin_ws/src/beamng-ros-integration/beamng_control/test/topics.test
-- run_tests.py: execute commands
/usr/bin/python3 /opt/ros/noetic/share/rostest/cmake/../../../bin/rostest --pkgdir=/home/ubuntu/catkin_ws/src/beamng-ros-integration/beamng_control --package=beamng_control --results-filename test_services.xml --results-base-dir "/home/ubuntu/catkin_ws/build/test_results" /home/ubuntu/catkin_ws/src/beamng-ros-integration/beamng_control/test/services.test
... logging to /home/ubuntu/.ros/log/rostest-DESKTOP-PUKHVO6-665.log... logging to /home/ubuntu/.ros/log/rostest-DESKTOP-PUKHVO6-667.log[ROSUNIT] Outputting test results to /home/ubuntu/catkin_ws/build/test_results/beamng_control/rostest-test_services.xml
[ROSUNIT] Outputting test results to /home/ubuntu/catkin_ws/build/test_results/beamng_control/rostest-test_topics.xml
[Testcase: testtest_topics] ... FAILURE!
FAILURE: Test node [beamng_control/test_topics.py] does not exist or is not executable
[Testcase: testtest_services] ... FAILURE!
FAILURE: Test node [beamng_control/test_services.py] does not exist or is not executable
File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
yield
File "/usr/lib/python3.8/unittest/case.py", line 676, in run
self._callTestMethod(testMethod)
File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
method()
File "/opt/ros/noetic/lib/python3/dist-packages/rostest/runner.py", line 93, in fn
self.fail(message)
File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
raise self.failureException(msg)
File "/usr/lib/python3.8/unittest/case.py", line 60, in testPartExecutor
yield
File "/usr/lib/python3.8/unittest/case.py", line 676, in run
self._callTestMethod(testMethod)
File "/usr/lib/python3.8/unittest/case.py", line 633, in _callTestMethod
method()
File "/opt/ros/noetic/lib/python3/dist-packages/rostest/runner.py", line 93, in fn
self.fail(message)
File "/usr/lib/python3.8/unittest/case.py", line 753, in fail
raise self.failureException(msg)


[ROSTEST]-----------------------------------------------------------------------

[testtest_topics][failed]

SUMMARY

  • RESULT: FAIL
  • TESTS: 0
  • ERRORS: 0
  • FAILURES: 1

ERROR: The following tests failed to run:

  • testtest_topics

rostest log file is in /home/ubuntu/.ros/log/rostest-DESKTOP-PUKHVO6-665.log

[ROSTEST]-----------------------------------------------------------------------

[testtest_services][failed]

SUMMARY

  • RESULT: FAIL
  • TESTS: 0
  • ERRORS: 0
  • FAILURES: 1

ERROR: The following tests failed to run:

  • testtest_services

rostest log file is in /home/ubuntu/.ros/log/rostest-DESKTOP-PUKHVO6-667.log
-- run_tests.py: verify result "/home/ubuntu/catkin_ws/build/test_results/beamng_control/rostest-test_topics.xml"
-- run_tests.py: verify result "/home/ubuntu/catkin_ws/build/test_results/beamng_control/rostest-test_services.xml"
Built target run_tests_beamng_control_rostest_test_services.test
Built target run_tests_beamng_control_rostest_test_topics.test
Built target run_tests_beamng_control_rostest
Built target run_tests_beamng_control`

Could not establish connection

windows machine :
Edition Windows 11 Home Insider Preview Single Language
Version Dev
Installed on ‎19/‎11/‎2021
OS build 22504.1010
Experience Windows Feature Experience Pack 1000.22504.1010.0

WSL2:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Ubuntu 20.04.3 LTS"

`ubuntu_20@DESKTOP-HKDK1FO:~/catkin_ws/src/beamng-ros-integration/beamng_control/launch$ roslaunch example.launch
... logging to /home/ubuntu_20/.ros/log/14bd33ec-51f1-11ec-9096-00155ded229e/roslaunch-DESKTOP-HKDK1FO-219.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.

started roslaunch server http://localhost:44479/

SUMMARY

PARAMETERS

  • /beamng/host: 192.168.0.113
  • /beamng/port: 64255
  • /rosdistro: noetic
  • /rosversion: 1.15.13

NODES
/
beamng_control (beamng_control/bridge.py)

ROS_MASTER_URI=http://localhost:11311

process[beamng_control-1]: started with pid [233]
2021-11-30 23:24:16,695 |INFO |beamngpy |Started BeamNGpy logging.
2021-11-30 23:24:16,696 |WARNING |py.warnings |/home/ubuntu_20/.local/lib/python3.8/site-packages/beamngpy/beamng.py:69: DeprecationWarning: The use of beamng.setup_logging is deprecated and will be removed in future versions. Use beamngcommon.set_up_simple_logging or beamngcommon.config_logging instead.
create_warning(warn_msg, DeprecationWarning)

2021-11-30 23:24:16,696 |WARNING |py.warnings |/home/ubuntu_20/.local/lib/python3.8/site-packages/beamngpy/beamng.py:69: DeprecationWarning: The use of beamng.setup_logging is deprecated and will be removed in future versions. Use beamngcommon.set_up_simple_logging or beamngcommon.config_logging instead.
create_warning(warn_msg, DeprecationWarning)

2021-11-30 23:24:16,696 |INFO |rosout |cmd args['/home/ubuntu_20/catkin_ws/devel/lib/beamng_control/bridge.py', '/home/ubuntu_20/catkin_ws/src/beamng-ros-integration/beamng_control/config/scenarios/simple_scenario.json']
2021-11-30 23:24:16,699 |INFO |beamngpy.BeamNGpy |Opening BeamNGpy instance.
2021-11-30 23:24:16,700 |INFO |beamngpy.BeamNGpy |Connecting to BeamNG.tech at: (192.168.0.113, 64255)
2021-11-30 23:24:16,932 |INFO |rospy.internal |topic[/rosout] adding connection to [/rosout], count 0
[FATAL] [1638285990.579056]: Could not establish connection, check whether BeamNG.tech is running.
2021-11-30 23:26:30,578 |CRITICAL |rosout |Could not establish connection, check whether BeamNG.tech is running.
2021-11-30 23:26:30,582 |WARNING |py.warnings |sys:1: ResourceWarning: unclosed <socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.30.153.206', 53498)>

2021-11-30 23:26:30,582 |WARNING |py.warnings |sys:1: ResourceWarning: unclosed <socket.socket fd=10, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('172.30.153.206', 53498)>

2021-11-30 23:26:30,582 |INFO |rospy.core |signal_shutdown [atexit]
2021-11-30 23:26:30,584 |INFO |rospy.internal |topic[/rosout] removing connection to /rosout
2021-11-30 23:26:30,585 |INFO |rospy.impl.masterslave |atexit
[beamng_control-1] process has died [pid 233, exit code 1, cmd /home/ubuntu_20/catkin_ws/devel/lib/beamng_control/bridge.py /home/ubuntu_20/catkin_ws/src/beamng-ros-integration/beamng_control/config/scenarios/simple_scenario.json __name:=beamng_control __log:=/home/ubuntu_20/.ros/log/14bd33ec-51f1-11ec-9096-00155ded229e/beamng_control-1.log].
log file: /home/ubuntu_20/.ros/log/14bd33ec-51f1-11ec-9096-00155ded229e/beamng_control-1*.log
all processes on machine have died, roslaunch will exit
shutting down processing monitor...
... shutting down processing monitor complete
done`

Error in loading vehicle through rosservice

ubuntu@DESKTOP-PUKHVO6:~$ rosservice call /beamng_control/spawn_vehicle 'ros' [10,15,10] [0,0,0,1] "/config/vehicles/etk800.json"
/usr/lib/python3/dist-packages/rosservice/init.py:607: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
service_args.append(yaml.load(arg))
ERROR: service [/beamng_control/spawn_vehicle] responded with an error: b"error processing request: The Lidar sensor definition is missing one or more fields. These fields where defined:\n{'vertical_resolution': 32, 'vertical_angle': 26.9, 'rps': 2200000, 'hz': 20, 'angle': 360, 'max_distance': 10, 'direction': [0, -1, 0], 'position': [0, 0, 1.7], 'axis': [0, -1, 0]}\nOriginal error message:\nCould not get Lidar instance, the json specification provided anunexpected input. List of possibleunexpected inputs:\n{'rps': 2200000, 'hz': 20, 'angle': 360, 'axis': [0, -1, 0], 'visualized': False}\nOriginal error message:\n__init__() got an unexpected keyword argument 'axis'"

Error with steps Goal

ubuntu@DESKTOP-PUKHVO6:~$ rostopic pub /beamng_control/step/goal beamng_msgs/StepActionGoal "header:

seq: 0
stamp:
    secs: 0
    nsecs: 0
frame_id: ''

goal_id:
stamp:
secs: 0
nsecs: 0
id: ''
goal:
total_number_of_steps: 50
feedback_cycle_size: 15"
/usr/lib/python3/dist-packages/rostopic/init.py:1782: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
pub_args.append(yaml.load(arg))

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.