Skip to content

CARMA on-Car Training

This is the tutorial for CARMA on-car training.

1 Preparation

Current CARMA version: V 4.2.0

Before running CARMA, we need to have the GPS module ready first, by ready, it means that the RTK mode of GPS module should be ready.

Step 1: Insert the nano-sim card into the GPS cardlepoint module

  • Tools:

    • SIM card slot - For inserting into the GPS module and also fit nano-SIM card.
    • Phillips screwdriver - For opening the cover of the SIM card.
  • As shown in the picture, the red box is where GPS cardlepoint module located in our black Lincoln:

  • You need to open the cover of the SIM card on GPS module with Phillips screwdriver.

  • Insert the nano sim card into the normal SIM card slot.

  • Insert the normal SIM card into the cardlepoint SIM card slot, as shown in the picture below:

  • You need to use Phillips screwdriver to screw the cover box back in, and you should be able to see the signal LED is flashing.
  • When the signal LED turns into blue, it means that the SIM card service is on-line.

Step 2: Connect wire

  • Tools:

    • 232-USB cable - For connecting the GPS module with the laptop
  • As shown in the figure below, you need to connect the 232-USB cable with the COM1 cable:

Step 3: GPS software preparation

  • Tools:

    • A windows Laptop - For setting up the GPS module
  • You need to download a software called: Novatel Connect on your laptop.

2 Low-level Control Modification

Warning

You only need to do this step for the new vehicle. You only need to do it once for a new Ubuntu system.

[TBD]

Step: Check the image

  • Navigate to lincoln_mkz folder
  • Inside the docker_compose.yml, uncomment some container and run only
    • ros basic
    • ssc controller

3 Change the map

  • Nvigate to /opt/carma/maps

  • Check the link by using the following command:

ls -ln
  • You should be able to see the following:
  lrwxrwxrwx 1    0    0        13 Dec  7 09:59 pcd_map.pcd -> entry_405.pcd
  lrwxrwxrwx 1    0    0        16 Dec  7 13:33 vector_map.osm -> entry_405_1r.osm
  • If you need to assign a new pcd map and vector map, you need to unlink the soft link first:
sudo rm pcd_map.pcd
sudo rm vector_map.osm
  • Link the new maps with the above two links:
sudo ln -s new_xxx.pcd pcd_map.pcd
sudo ln -s new_xxx.osm vector_map.osm
  • Replace new_xxx.pcd with your new pcd map.
  • Replace new_xxx.osm with your new vector map.

Visualize Vector maps

To check the vector map, use JOSM:JAVA Open Street Map to visualize vector map.

From the app center, click the JOSM icon:

Here is what it looks like in the JOSM interface:

Change the route

Step 1: Visualize map

To change the route, you need to visualize your vector map in JOSM.

Step 2: map projection for new maps

After you open the osm in the JOSM, click the edit > preferemce:

Select Map Projection from the left manual, then select Custom Projection from the right side of the drop-down manual. As shown below:

lat, log -> utm

Step 3: Copy geoReference infomation

From your osm vector map file, there is a one line of code looks like this:

<geoReference>+proj=tmerc +lat_0=34.067086 +lon_0=-118.4610826 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs </geoReference>

Copy the following content to the JOSM window as shown in the below.

Copy:

tmerc +lat_0=34.067086 +lon_0=-118.4610826 +k=1 +x_0=0 +y_0=0 +datum=WGS84 +units=m +geoidgrids=egm96_15.gtx +vunits=m +no_defs

To:

Step 3: Select the node

Select a node point in the vector map and use it as your destination.

Step 4: Get the position

Click the node and click Move node from the drop down manual.

Step 5: Copy the latitude and longitude of the node point

You will see the following window:

4 Change the speed limit

Warning

This step is important before you run your program.

For different scenarios, you need to change the speed limit in order to fit the correct speed limit. For example:

  • On the parking lot, the speed limit is about 10 miles/hour.
  • On the normal city road, the speed limit is about 35 miles/hour.

To change the speed limit, you need to:

  • Navigate to /home/carma/carma_ws/src/carma-config/Lincoln_mkz_2021 directory.

  • Open VehicleConfigParams.yaml in your favorable editor.

  • Navigate to the following line:

# Parameter to enable configurable speed limit
# Value type: Desired
config_speed_limit: 35.0
  • Change the config_speed_limit parameter and then save the file.

  • Rebuild your Lincoln_mkz_2021 image:

  • Navigate to /home/carma/carma_ws/src/carma-config/Lincoln_mkz_2021

  • In the terminal, type the following command:

    ./build-image.sh
    
  • After your image build is done, you will see a image tag of this image, in the terminal:

    carma config set [image tag]
    

5 Software running

Step 1: Set up configuration

In lincoln_mkz image,

Step 2: Start CARMA

  • Open a terminal and start CARMA
carma start all

Step 3: Start RVIZ

  • Start RVIZ in another terminal
  • Select the carma_default.rviz for viewing the map and current car location.

Step 4: Select a route

  • Open the browser and input the localhost to open CARMA interface.
  • Activate Debug mode.
  • Start CARMA
  • Select route from the left manual

Step 5: Check the route and start

  • Go to your RVIZ.
  • Check the route from the RVIZ interface.
  • Click the big start from the browser and activate vehicle

6 Commands

The following are some common commands:

carma start all
carma stop all
docker container ls
docker exec -it [container_id] bash
# in the container
cd /opt/carma
source install/setup.bash
  • [container_id] is something you will need to change into your container id.

7 Issues

When the vehicle cannot move, in the CARMA interface website, when you select route and it says "Route generated failed", probably because:

  • Your vehicle is not on the lane where you can see those way points
  • On the vector map, the lane line type is "solid" instead of "dash", go to the osm file and change it directly from there.(Please do not save it from JOSM)