Here is a good starting point, however, it might need a polynomial regression.
Studio Invanity
Interactive Design Electronic Art
Thursday, June 20, 2024
Calibrating the vl5310x TOF laser distance sensor.
Sunday, June 2, 2024
Pinky's Lighthouse
After getting communication set up with the Raspberry Pi controller in this post, we are off to send and interpret sensor data with ROS2.
Cartographer is a good starting point. In my ROS2 docker container:
sudo apt install ros-$ROS_DISTRO-cartographer
It installs, but it looks like CARTOGRAPHER IS NOT SUPPORTED ON IRON... I don't know why this package is available...
Moving on to nav2.
From inside the container, I can't launch GUIs. My working container must be committed to create a new image and re-run with the following:
sudo docker run -it \
--privileged \
-p 8888:8888/udp \
--name c5cont \
--env DISPLAY=$DISPLAY \
--env QT_X11_NO_MITSHM=1 \
--volume /tmp/.X11-unix:/tmp/.X11-unix \
--cpus="3" \
c5 /bin/bash
Also look into creating a dockerfile:
I'll have to reformat the data sent from the lighthouse IMU and laser distance sensor to mimic a lidar array.
Friday, February 16, 2024
RL training using Nvidia Omniverse
How to run Isaac gym on my computer:
C:\Users\jynx4\AppData\Local\ov\pkg\isaac_sim-2023.1.1\isaac-sim.gym.bat --ext-folder D:\isaac\
This includes default robots. In order to run training on Pinky, many files must be created along with importing a .xacro or .urdf robot description into a USD stage.
Modify this file:
by adding "omni.isaac.sensor" = {} at the end.- Stance: the foot is in contact with the ground
- Loading: the foot transitions from non-contact to contact
- Travel: foot follows the opposite vector of the command
- Pre-swing: as the foot nears the end of its range of motion, it waits for 4 feet to be in contact with the ground
- Swing: the food is in the air
- Unloading: the foot transitions from non-contact to contact
- Position: the foot lifts to a minimum height for clearance while maintaining minimal distance from the center of the robot.
- Travel: moves to maximize its stride
- Pre-stance: waits until only 3 feet are in contact with the ground
Friday, February 9, 2024
Micro-ROS adventure
PS C:\Program Files\uagent_superbuild\bin> .\MicroXRCEAgent.exe udp4 -p 2018 -v 6
Monday, January 15, 2024
Pinky: ROSberry pi controller
- sudo docker ps -a
- sudo docker start existing_container_ID_or_name
- sudo docker start c4
- sudo docker exec -it existing_container_ID_or_name /bin/bash
- sudo docker exec -it c4 /bin/bash
- check version with "printenv ROS_DISTRO"
- cd ~/colcon_venv/
- source ./rosvenv/bin/activate
- MicroRos
- source install/local_setup.bash
- ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888
ANALOG:
- Up/down is chan1,
- Left/Right is chan2
- Twist is chan0.
- Joystick button
- GPIO 12
- D-Pad
- Up
- Down
- Left
- Right
- Center
- Rotary Encoder
Setting up a second network adapter as a wifi access point for Pinky's onboard microcontrollers to connect to:
- It is coming up as WLAN0 after reboots, this is unwanted behavior. So let's make it WLAN1 and the onboard should be WLAN0.
Persistent Interface Naming
If your built-in WiFi adapter is being labeled
wlan1
instead ofwlan0
and you want to ensure consistent naming, you can create a custom udev rule to assign the names based on the MAC address.Find the MAC Address:
Identify the MAC address of your built-in WiFi adapter using the steps above.
Create a udev Rule:
Create a new udev rule file:
bashsudo nano /etc/udev/rules.d/70-persistent-net.rules
Add a rule to assign a specific name based on the MAC address. Replace
xx:xx:xx:xx:xx:xx
with the MAC address of your built-in WiFi adapter:plaintextSUBSYSTEM=="net", ACTION=="add", ATTR{address}=="xx:xx:xx:xx:xx:xx", NAME="wlan0"
You can also add a rule for your USB adapter if needed:
plaintextSUBSYSTEM=="net", ACTION=="add", ATTR{address}=="yy:yy:yy:yy:yy:yy", NAME="wlan1"
Reload udev Rules and Reboot:
Reload the udev rules and reboot the system:
bashsudo udevadm control --reload-rules sudo reboot
After rebooting, your built-in WiFi adapter should be consistently named
wlan0
.- The desktop network manager is telling me that AP mode is not possible with the new dongle. I may have to switch to having the onboard be the AP and the new adapter be my internet connection.
- I switched to an edimax wifi dongle and then did this:
Step-by-Step Setup
Update and Install Required Packages:
bashsudo apt-get update sudo apt-get upgrade sudo apt-get install hostapd dnsmasq iptables
Configure Static IP for
wlan1
:Edit
/etc/dhcpcd.conf
:bashsudo nano /etc/dhcpcd.conf
Add:
plaintextinterface wlan1 static ip_address=192.168.4.1/24 nohook wpa_supplicant
Configure
dnsmasq
:Backup existing configuration and create a new one:
bashsudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig sudo nano /etc/dnsmasq.conf
Add:
plaintextinterface=wlan1 dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h
Configure
hostapd
:Create or edit the configuration file:
bashsudo nano /etc/hostapd/hostapd.conf
Add:
plaintextinterface=wlan1 driver=nl80211 ssid=MyNetwork hw_mode=g channel=7 wmm_enabled=0 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=MyPassword wpa_key_mgmt=WPA-PSK rsn_pairwise=CCMP
Edit
/etc/default/hostapd
to set the configuration file path:plaintextDAEMON_CONF="/etc/hostapd/hostapd.conf"
Enable and Start Services:
bashsudo systemctl unmask hostapd sudo systemctl enable hostapd sudo systemctl start hostapd sudo systemctl restart dnsmasq
Enable IP Forwarding:
Edit
/etc/sysctl.conf
:bashsudo nano /etc/sysctl.conf
Uncomment or add:
plaintextnet.ipv4.ip_forward=1
Apply the changes:
bashsudo sysctl -p
Configure NAT with iptables:
bashsudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE sudo sh -c "iptables-save > /etc/iptables.ipv4.nat"
Add to
/etc/rc.local
to restore iptables rules on boot:plaintextiptables-restore < /etc/iptables.ipv4.nat
- Now for testing with my ros2 in docker and micropython on my microcontroller...
- Build micro-ros for this install
- I can see my ESP32 connected with:
- cat /var/lib/misc/dnsmasq.leases
- I can see packets over port 8888 with:
- sudo tcpdump -v -i wlan1 udp port 8888
- ESP32 devkit and esp32CAM enter error loop after the memory allocator is initialized.
- Find port conflicts with netstat and lsof
- SOLVED:The micropython agent on the controller must be started before the microcontrollers are powered on. Otherwise, they will go into an error loop when initializing support.
- Getting display to work from a container
- export DISPLAY=:0