290 likes | 398 Views
Detection of EntityContact and Reaction. Robotics Beginner Course – 19. Young Joon Kim http://www.helloapps.com. Topics. SPL Script for enabling EntityContact to be detectable Detecting EntityContact on the VPL Reaction for the EntityContact.
E N D
Detection of EntityContact and Reaction Robotics Beginner Course – 19 Young Joon Kim http://www.helloapps.com
Topics • SPL Script for enabling EntityContact to be detectable • Detecting EntityContact on the VPL • Reaction for the EntityContact
SPL Script for enabling entity-contact to be detectable • Start with the basic environment
SPL Script for enabling entity-contact to be detectable • Add a entity • Add a Box Shape
SPL Script for enabling entity-contact to be detectable • Add “/EnableContactNotification:” option
SPL Script for enabling entity-contact to be detectable • Remove “/Procedure:” option line Delete line
SPL Script for enabling entity-contact to be detectable • Add a DifferentialDriveEntity
SPL Script for enabling entity-contact to be detectable • Add “/Position:” option • Change the z-position with “1.0”
SPL Script for enabling entity-contact to be detectable • Add “FlushScript”
SPL Script for enabling entity-contact to be detectable • Save script with the name of “script/EntityContact1.txt”
SPL Script for enabling entity-contact to be detectable • Executed result
Detect EntityContact on the VPL • Build diagram to load sim environment
Detect EntityContact on the VPL • Add “SPL Sensors” and “Calculate” activity • Connect “SPLSensors” and “Calculate”
Detect EntityContact on the VPL • Select “EntityContactNotify” from the list
Detect EntityContact on the VPL • Select “EntityName”
Detect EntityContact on the VPL • Type expression as follows • Select “Touched” from the list
Detect EntityContact on the VPL • Add “HelloApps Console” service
Detect EntityContact on the VPL • Add “SimpleDashboard”
Detect EntityContact on the VPL • Control the robot in order to make robot collide with box
Detect EntityContact on the VPL • Executed results
Reaction for the EntityContact • Build diagram to load sim environment • Add a “SPL Sensors”
Reaction for the EntityContact • Add “If” activity • Connect “SPLSensors” and “If” activity
Reaction for the EntityContact • Select “EntityContactNotify”
Reaction for the EntityContact • Add “Data” and “SPLDrive” • Type “base1.GoTo(-1.0, 0.2)” on the “Data” activity • Move backwards 1.0m with 0.2 power
Reaction for the EntityContact • Add diagram to move forwards
Reaction for the EntityContact • Save diagram and execute