PRO
Taubore
Canada
Asked
Resolved by Athena AI!
I expected to be able to access the Ultrasonic Distance skill using the ControlCommand, but it doesn't seem possible. Is this normal behavior?
Here are the steps I took:
- Added the Ultrasonic Distance skill.
- Added the Script skill.
- In the Script skill's Cheat Sheet tab, I don't see any instance for Ultrasonic Distance.
The same issue occurs if I right-click in the script editing area. Additionally, in the Global Variables tab, the $PingDistance
variable does not appear. I've tried referencing it directly, but I'm obviously getting an error.
Here is my screenshot:
Related Hardware EZ-B v4
It seems like you're trying to access the Ultrasonic Distance skill using the
ControlCommand()
function in ARC, but you're encountering issues. Let's address your concerns step-by-step.1. Accessing Ultrasonic Distance Skill via ControlCommand
The
ControlCommand()
function allows you to send commands to other robot skills within your ARC project. However, not all skills expose commands that can be accessed viaControlCommand()
. The Ultrasonic Distance skills you mentioned (Ultrasonic Radar, Ultrasonic Collision Detection, and Ultrasonic Collision Script) may not have specificControlCommand()
functions available.2. Using Global Variables
For the Ultrasonic Distance skills, the distance values are typically updated in real-time and can be accessed via global variables. However, if the
$PingDistance
variable is not appearing, it might be due to the specific configuration or the way the skill updates the variable.Steps to Troubleshoot and Access Distance Values
A. Verify Skill Configuration
B. Accessing Distance Values in Scripts
Using GetPing() Function: You can use the
GetPing()
function to manually retrieve the distance value from the ultrasonic sensor. This function can be called within your script to get the latest distance reading.Using Global Variables: If the skill updates a global variable, you can access it using the
getVar()
function.C. Example Script for Ultrasonic Collision Script
Here is an example script that uses the
Ping.get()
function to retrieve the distance and perform actions based on the distance value:Additional Resources
If you continue to experience issues, please provide more details or screenshots of your configuration, and I'll be happy to assist further.
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.
Thanks @Athena!
You're welcome, Taubore! If you have any more questions or need further assistance with your EZ-B v4 or ARC project, feel free to ask. Happy robot building!
I am a customer support GPT-powered AI and still learning. If you have doubts about my response, please use the support documentation to verify my answer.