Skip to content

Basic Function Programming

Basic Functions

The image installed on OriginCar Pro includes ROS 2 Humble / TogetheROS, as well as the low-level driver package and camera driver package for OriginCar Pro. Their usage is described below.

Chassis Driver

Log in to the OriginCar Pro system using any one of the remote connection methods, then enter the following command:

#Start the chassis 
ros2 launch origincar_base origincar_bringup.launch.py       

Button Control

Start button control after the chassis driver has been started; OriginCar Pro will then move according to the commands.

# Start another terminal and enter the following command
ros2 run teleop_twist_keyboard teleop_twist_keyboard 
Note: Because it uses Ackermann steering, OriginCar Pro cannot move left or right without linear velocity.

Human Detection

Human detection serves as a camera driver demo in OriginCar Pro. Users can run the human detection function to verify the camera and use it as a reference when implementing similar vision functions.

# Open a new terminal and enter the following command
# Start the camera 
ros2 launch origincar_bringup usb_websocket_display.launch.py 
Note: The images output by this command are displayed on the web page. Connect OriginCar Pro and the PC to the same LAN, then enter the OriginCar Pro IP address and port 8000 in a browser to open the corresponding web page. See the figure below.

Web display

Keyboard Control

Start the chassis on OriginCar Pro

ros2 launch origincar_base origincar_bringup.launch.py        #Start the chassis 

Start the chassis

At this point, in the digital environment, press the r key on the keyboard to start host computer control.

Host computer operation prompt

Press WSAD to move OriginCar Pro.