Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/mosaic carla sumo ambassadors #17

Merged
merged 58 commits into from
Dec 14, 2021

Conversation

kjrush
Copy link
Contributor

@kjrush kjrush commented Jun 4, 2021

PR Details

Description

The folder co-simulation tool contains the source code of CARLA-SUMO-MOSAIC integration. It integrates CARLA and SUMO with Eclipse MOSAIC framework.

Related Issue

This is the source code of CARLA-SUMO-MOSAIC integration.

Motivation and Context

How Has This Been Tested?

There is a test folder in the source code.

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    CARMA Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Details

Description

The folder co-simulation tool contains the source code of CARLA-SUMO-MOSAIC integration. It integrates CARLA and SUMO with Eclipse MOSAIC framework.

Related Issue

This is the source code of CARLA-SUMO-MOSAIC integration.

Motivation and Context

How Has This Been Tested?

There is a test folder in the source code.

Types of changes

  • Defect fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that cause existing functionality to change)

Checklist:

  • I have added any new packages to the sonar-scanner.properties file
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
    CARMA Contributing Guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.


For a successful running of the co-simulation tool, the following software must be installed:

- CARLA simulator
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does CARLA version need to be addressed? I believe this co-simulation tool does not support all CARLA version.

Copy link
Contributor

@DFCui DFCui Jun 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CARLA version 0.9.10 was added in the README.md.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it only support CARLA 0.9.10 or it just need the CARLA start script?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It needs CARLA start script and CARLA python API library .egg. We tested CARLA 0.9.10, 0.9.10.1, and 0.9.11. Since you asked us to use CARLA 0.9.10, the default CARLA python API library .egg is for CARLA 0.9.10 and the users should use CARLA 0.9.10..


The co-simulation tool has been built successfully on different Operating Systems (OS). The building results are shown in the following table.

| Test NO. | OS | OS Version | Java JDK | Maven | SUMO | Building Results |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add the testing CARLA version in the form.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When building the bundle file of co-simulation tool from the source code, CARLA is not needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the build package is not tested in the environment you mentioned in this form, please do not include this form here. Building successfully does not mean running successfully. It is confusing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The form has been removed from README.md.

mvn clean install -DskipTests
```

- After building, go to bundle\target directory, a zip file of co-simulation bundle can be found.
Copy link
Contributor

@fangzhou1227 fangzhou1227 Jun 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of "a zip file of co-simulation bundle" is still "eclipse-mosaic-21.1-SNAPSHOT". Can we change the name to something like "co-simulation" and specify the name here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version "21.1-SNAPSHOT" has been changed to "1.0". The name of bundle "eclipse-mosaic-21.1-SNAPSHOT" has been changed to "carla-sumo-mosaic-1.0". The bundle name was updated in the README.md.


## **Folder Content**

The folder structure of co-simulation tool is described in the following.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify the name of the folder here. It is confusing that which is the folder of co-simulation tool.

Copy link
Contributor

@DFCui DFCui Jun 24, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The folder name cosimulation-root has been added in the README.md.

print(message)

# Send V2x message to CARLA ambassador
if self.sendV2xInterval == 10:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the meaning of interval equals to 10 here? Is that necessary to be a fix number?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here 10 means every 10 time-step. I assume that CARLA vehicles send V2X messages every 10 time steps. It can be set as any integer depending on users needs.


addEvent(event);
// Send received externalV2xMessage to the corresponding ambassador
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any chance that the receiver name will not be "carma","carla" and "rsu"? if so, could you add else function add the end to deal with the exception?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The receiver may be SUMO vehicles. We do not need to send V2X messages to SUMO ambassador and then send V2X messages to SUMO federate. An else statement to log info has been added. In addition, there is no exception here.

.getUnitFromId(v2xMessageAcknowledgement.getSourceName());
// we don't simulate vehicles without an application
if (simulationUnit == null) {
return;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to add log info as what you did in the line 618 and will also be better to apply for line 650 and 664

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The log info have been added in line 599, 650, and 664.

* @param surroundingVehiclesRadius The radius around the ego vehicle for which
* vehicle data is to be sent.
* @param vehicleTypeId Id of the vehicle type.
* @param vehicleDeparture Vehicle departure information.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide more information about this parameter, such as in what situation this parameter will be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VehicleDeparture provides the information about vehicle initialization. For example, when you spawn a CARMA vehicle in co-simulation tool, you need to provide the vehicle departure information such as the route ID, lane number, the position on the lane, the departure speed, i.e., where the vehicle will be spawned and what is the departure speed, etc.

@@ -0,0 +1,222 @@
# Running CARLA-SUMO-MOSAIC Co-Simulation Tool with NS-3 Integration in Docker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to change the name of this user guide to README.md then Github will directly show the content in the page.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The user guide has been renamed as README.md.

##### Step 1: Run the following command to build the docker image

```
docker build - < Dockerfile -t ns3-integration
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ns3-integration should be changed to ns-3-integration

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ns3-integration has been changed to ns-3-integration.


if response != command:
raise FatalTraCIError("Received answer %s for command %s." % (response, command))
return result.readStringList()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably adding one more tab here. Return method in the viewing mode is inside of condition method. Try to put that outside of condition method

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The statement has been indented as suggested.


(If you see a message `vim: command not found`, please use `sudo apt-get install vim` to install vim as text editor)

In line 365, change
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like not in the exactly line 365 from my side. Could you please double check about this part?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The location has been specified in the user guide.

@kjrush kjrush merged commit 1edbc1e into develop Dec 14, 2021
@kjrush kjrush deleted the feature/mosaic-carla-sumo-ambassadors branch December 14, 2021 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants