Important Updates Post Qualification Round

These updates has to be made by the participants in order to prepare for the final round of NXP AIM challenge

Adding contact sensor to the car main body (Mandatory)

The participants must add the following lines of code to enable contact sensor on the car body to determine car collision with obstacles.

To do so open nxp_cupcar.sdf.jinja located at ~/ros2ws/nxp_gazebo/models/nxp_cupcar in the software stack. Add the following lines of codes inside link tag with name="{{model_name}}_frame_link" below the collision sub-tag:

<!--contact sensor test-->
      <sensor name="car_contact" type="contact">
        <contact>
          <collision>{{ model_name }}_frame_collision</collision>
        </contact>
        <update_rate>5</update_rate>
        <alwaysOn>true</alwaysOn>
      </sensor>

After the addition of this code the file must look like this:

To see the output captured by the contact sensor, open a new terminal while the simulation is running and execute the following command:

$ gz topic -e /gazebo/canvas/sitl_nxp_cupcar_0/sitl_nxp_cupcar_0_frame_link/car_contact/contacts

Adding a new node to observe input image captured Pixy Camera (Optional)

Those who wish to visualize the input data, in this case, the image; captured by the Pixy Camera attached to the car, will have to follow the below steps.

Open nxp_track_vision.py located at ~/ros2ws/src/nxp_cup_vision/nxp_cup_vision in the software stack. First add the following line of code in __init__() method function in NXPTrackVision class definition under the #Publishers:

self.debugDetectionImagePub2 = self.create_publisher(sensor_msgs.msg.Image,
            '/{:s}'.format("Camera_Input"), 0)

Now add another block of code in **pixyImageCallback()**method function under if self.debug: condition:

msg2=self.bridge.cv2_to_imgmsg(scene, "bgr8")
msg2.header.stamp = data.header.stamp
self.debugDetectionImagePub2.publish(msg2)

The input image then can be visualized in the QT viewer when the simulation is running as seen in the images below:

Last updated