ModalAI Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. Judoor 0
    J
    • Profile
    • Following 0
    • Followers 1
    • Topics 16
    • Posts 56
    • Best 4
    • Controversial 0
    • Groups 0

    Judoor 0

    @Judoor 0

    4
    Reputation
    12
    Profile views
    56
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    Judoor 0 Unfollow Follow

    Best posts made by Judoor 0

    • Instruction to set a Static IP for wlan0 voxl2

      Guide to Configure a Static IP Address with systemd-networkd
      I didn't find any guide on how to do it with the voxl2, even the static-ip service seem reserved for eth0 configuration, tell me, if i'm wrong i'll delete this.

      If you want to assign a static IP address to your wireless network interface (using systemd-networkd), follow this simple guide. In this example, we configure the wlan0 interface to use the static IP address 192.168.XX.XX.


      1. Check the Status of systemd-networkd

      Before starting, ensure that systemd-networkd is enabled and running:

      sudo systemctl status systemd-networkd
      

      If the service is not active, enable it:

      sudo systemctl enable systemd-networkd
      sudo systemctl start systemd-networkd
      

      2. Create the Configuration File for wlan0

      1. Navigate to the configuration directory:

        cd /etc/systemd/network/
        
      2. Create a configuration file for your wireless interface (e.g., 10-wlan0.network)

        sudo nano 10-wlan0.network
        
      3. Add the following lines to the file:

        [Match]
        Name=wlan0
        
        [Network]
        Address="192.168.XX.XX"/24
        Gateway="192.168.XX.1"
        DNS=8.8.8.8 1.1.1.1
        

        Explanation:

        • Name=wlan0: Specifies the target interface.
        • Address=192.168.XX.XX/24: Defines the IP address and subnet mask.
        • Gateway=192.168.XX.1: Sets the default gateway.
        • DNS=8.8.8.8 1.1.1.1: Configures the DNS servers.
      4. Save and close the file.


      3. Restart systemd-networkd

      Apply the new configuration by restarting the service:

      sudo systemctl restart systemd-networkd
      

      4. Verify the Configuration

      To verify that the IP address has been assigned to wlan0:

      ip addr show wlan0
      

      You should see the IP address 192.168.XX.XX assigned to the interface.


      5. Enable the Service at Boot

      Ensure that systemd-networkd is enabled to run at every boot:

      sudo systemctl enable systemd-networkd
      

      6. Reboot the System

      To confirm everything works correctly on startup:

      sudo reboot
      

      You have now successfully configured a static IP address for the wlan0 interface using systemd-networkd on your voxl2!

      posted in Software Development
      J
      Judoor 0
    • RE: Error when launching mpa_to_ros2

      @Zachary-Lowell-0 well it work now!
      I found these lines on another thread of the forum:

      sudo apt-get install voxl-ros2-foxy
      sudo apt-get install voxl-mpa-to-ros2
      voxl-configure-mpa-to-ros2
      source /opt/ros/foxy/mpa_to_ros2/install/setup.bash
      export ROS_HOME=/opt/foxy
      ros2 run voxl_mpa_to_ros2 voxl_mpa_to_ros2_node
      

      And everything worked first time ! So please put these line directly on the documentation cause I lost so much time with this install !

      posted in ROS
      J
      Judoor 0
    • RE: Install libopencv on Starling 2

      @Alex-Kushleyev @wilkinsaf Thanks for your answers! Actually, I've done something similar with docker, but I still have a few problems with the data format that mpa_to_ros sends. To address this, I did the following:

      #!/usr/bin/env python
      import rospy
      import cv2
      import numpy as np
      from sensor_msgs.msg import Image, CameraInfo
      from cv_bridge import CvBridge, CvBridgeError
      import yaml
      
      class CamImageConverter:
          def __init__(self):
              self.bridge = CvBridge()
              
              # Subscribers
              rospy.Subscriber("/drone/tof_depth/image_raw", Image, self.depth_callback)
              rospy.Subscriber("/drone/hires/image_raw", Image, self.rgb_callback)
              rospy.Subscriber("/drone/tracking_front/image_raw", Image, self.tracking_callback)
              
              # Publishers
              self.depth_pub = rospy.Publisher("/drone/tof_depth/image", Image, queue_size=1000)
              
              self.rgb_pub = rospy.Publisher("/drone/hires/image", Image, queue_size=1000)
              self.rgb_info_pub = rospy.Publisher("/drone/hires/camera_info", CameraInfo, queue_size=1000)
              self.tracking_pub = rospy.Publisher("/drone/tracking_front/image", Image, queue_size=1000)
              self.tracking_info_pub = rospy.Publisher("/drone/tracking_front/camera_info", CameraInfo, queue_size=1000)
      
              self.camera_info_msg = self.load_camera_info("/root/ros_ws/src/cam_converter/calibration/ost.yaml")
      
              rospy.Timer(rospy.Duration(1.0 / 30), self.publish_tracking_info)
              rospy.Timer(rospy.Duration(1.0 / 30), self.publish_rgb_info)
      
          def load_camera_info(self, filename):
              with open(filename, "r") as file:
                  calib_data = yaml.safe_load(file)
                  camera_info_msg = CameraInfo()
                  camera_info_msg.height = calib_data["image_height"]
                  camera_info_msg.width = calib_data["image_width"]
                  camera_info_msg.distortion_model = calib_data["distortion_model"]
                  camera_info_msg.D = calib_data["distortion_coefficients"]["data"]
                  camera_info_msg.K = calib_data["camera_matrix"]["data"]
                  camera_info_msg.R = calib_data["rectification_matrix"]["data"]
                  camera_info_msg.P = calib_data["projection_matrix"]["data"]
                  return camera_info_msg
      
          def depth_callback(self, msg):
              try:
                  # Convertir le message ROS en une image OpenCV
                  raw_image = self.bridge.imgmsg_to_cv2(msg, desired_encoding="mono8")
      
                  # Normalisation de l'image pour améliorer la qualité
                  depth_image = cv2.normalize(raw_image, None, 0, 65535, cv2.NORM_MINMAX).astype(np.uint16)
      
                  # Publier l'image convertie
                  converted_msg = self.bridge.cv2_to_imgmsg(depth_image, encoding="16UC1")
                  converted_msg.header.frame_id = 'tof_link'
                  converted_msg.header.stamp = rospy.Time.now()
                  self.depth_pub.publish(converted_msg)
      
              except CvBridgeError as e:
                  rospy.logerr("CvBridge Error: {0}".format(e))
      
          def rgb_callback(self, msg):
              try:
                  # Convertir le message ROS en une image OpenCV
                  raw_image = self.bridge.imgmsg_to_cv2(msg, desired_encoding="passthrough")
      
                  # Conversion YUV422 ou NV12 en RGB8
                  if msg.encoding == "yuv422":
                      rgb_image = cv2.cvtColor(raw_image, cv2.COLOR_YUV2RGB_Y422)
                  elif msg.encoding == "nv12":
                      yuv_image = np.frombuffer(msg.data, dtype=np.uint8).reshape((msg.height * 3 // 2, msg.width))
                      rgb_image = cv2.cvtColor(yuv_image, cv2.COLOR_YUV2RGB_NV12)
                  else:
                      rospy.logerr("Unsupported encoding: {}".format(msg.encoding))
                      return
      
                  # Redimensionner l'image RGB pour qu'elle ait la même taille que l'image ToF (240x180)
                  resized_rgb_image = cv2.resize(rgb_image, (180, 240), interpolation=cv2.INTER_LINEAR)
      
                  # Publier l'image convertie et redimensionnée
                  converted_msg = self.bridge.cv2_to_imgmsg(resized_rgb_image, encoding="rgb8")
                  converted_msg.header.frame_id = 'hires_link'
                  converted_msg.header.stamp = rospy.Time.now()
                  self.rgb_pub.publish(converted_msg)
      
              except CvBridgeError as e:
                  rospy.logerr("CvBridge Error: {0}".format(e))
      
          def tracking_callback(self, msg):
              try:
                  # Convertir le message ROS en une image OpenCV
                  raw_image = self.bridge.imgmsg_to_cv2(msg, desired_encoding="passthrough")
      
                  # Redimensionner l'image RGB pour qu'elle ait la même taille que l'image ToF (240x180)
                  resized_image = cv2.resize(raw_image, (180, 240), interpolation=cv2.INTER_LINEAR)
      
                  # Publier l'image convertie et redimensionnée
                  converted_msg = self.bridge.cv2_to_imgmsg(resized_image)
                  converted_msg.header.frame_id = 'tracking_front_link'
                  converted_msg.header.stamp = rospy.Time.now()
                  self.tracking_pub.publish(converted_msg)
      
              except CvBridgeError as e:
                  rospy.logerr("CvBridge Error: {0}".format(e))
      
          def publish_rgb_info(self, event):
              self.camera_info_msg.header.stamp = rospy.Time.now()
              self.camera_info_msg.header.frame_id = 'hires_link'
              self.rgb_info_pub.publish(self.camera_info_msg)
      
          def publish_tracking_info(self, event):
              camera_info_msg = CameraInfo()
              camera_info_msg.header.frame_id = 'tracking_front_link'
              camera_info_msg.header.stamp = rospy.Time.now()
      
              camera_info_msg.height = 240
              camera_info_msg.width = 180
              camera_info_msg.distortion_model = 'plumb_bob'
              camera_info_msg.D = [5.0234834483837899e-02, 3.2967878240805777e-02, -1.6468916528340826e-02, 1.8155367951008903e-03]
              camera_info_msg.K = [4.6177826259848081e+02, 0., 6.1505488982380564e+02, 0., 4.6160870283061041e+02, 4.1065345867690684e+02, 0., 0., 1.]
              camera_info_msg.R = [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]
              camera_info_msg.P = [4.6177826259848081e+02, 0., 6.1505488982380564e+02, 0., 0., 4.6160870283061041e+02, 4.1065345867690684e+02, 0., 0., 0., 1., 0.]
      
              self.tracking_info_pub.publish(camera_info_msg)
         
          
      def main(): 
          rospy.init_node('cam_image_converter', anonymous=True)
          CamImageConverter()
          rospy.spin()
      
      if __name__ == '__main__':
          main()
      

      I don't know if this is the right way to do it, but it seems to work. Do you have any suggestions for implementing this directly on the Voxl2?

      Also, I have a few problems with camera calibrations and the drone model. Do you have any files that contain all the data for the cameras (ToF, tracking, and high-resolution) and a model of the drone that I can use in RViz and Gazebo? This could really help me.

      For more context, I'm trying to implement this project for Autonomous SLAM with ROS. Has anyone already used RTAB-Map on this drone? Do you have any advice to solve this problem?

      Thank you for your help

      posted in VOXL 2
      J
      Judoor 0
    • RE: Instruction to set a Static IP for wlan0 voxl2

      Another way to do it, maybe more in line with the way modal ai intended it is this :

      Update dhcpcd.conf for Static IP
      Open the dhcpcd.conf file for editing:

      nano /etc/dhcpcd.conf
      

      Add the following lines at the end of the file to configure a static IP for wlan0:

      interface wlan0
      static ip_address=192.168.XX.XX/24
      static routers=192.168.XX.1
      static domain_name_servers=8.8.8.8 1.1.1.1
      

      Explanation:

      interface wlan0: Specifies the network interface to configure.
      static ip_address=192.168.XX.XX/24: Assigns the static IP and subnet mask.
      static routers=192.168.XX.1: Sets the gateway address.
      static domain_name_servers=8.8.8.8 1.1.1.1: Configures DNS servers (Google and Cloudflare in this case).
      Save and exit the file.

      Restart dhcpcd Service
      Apply the changes by restarting the dhcpcd service:

      systemctl enable dhcpcd
      systemctl restart dhcpcd
      
      posted in Software Development
      J
      Judoor 0

    Latest posts made by Judoor 0

    • RE: LIO with TOF LiDAR: Seeking Point Intensity & Noise Data from mpa_to_ros

      @Aaron-Porter Hi Aaron, Yes i'm using the modalAI TOF with a Starling2 MAX. If you can test it, I'll appreciate it ! Thank you!

      posted in Ask your questions right here!
      J
      Judoor 0
    • LIO with TOF LiDAR: Seeking Point Intensity & Noise Data from mpa_to_ros

      Hello everyone,

      I'm working on developing a LIO (LiDAR-Inertial Odometry) algorithm and am looking to use TOF (Time-of-Flight) LiDAR data.

      When I look at the ROS messages published by mpa_to_ros, I only seem to receive the points positions. I'm wondering if it's possible to also include the intensity value and noise information for each point?

      Any insights or suggestions would be greatly appreciated!

      posted in Ask your questions right here!
      J
      Judoor 0
    • RE: IMU stream rate fixed at 10Hz (PX4)

      @Eric-Katzfey I'm using integrated IMU with VOXL2

      posted in ROS
      J
      Judoor 0
    • IMU stream rate fixed at 10Hz (PX4)

      Hello,
      I'm using an IMU with PX4 firmware. I attempted to change the stream rate of the IMU data to at least 50Hz, instead of the default 10Hz. However, when I use rosservice /mavros/set_stream_rate or rosservice /mavros/set_message_interval, there is no change.
      Could this be related to MPA, PX4, or another factor?
      Thanks in advance.

      posted in ROS
      J
      Judoor 0
    • RE: Instruction to set a Static IP for wlan0 voxl2

      Another way to do it, maybe more in line with the way modal ai intended it is this :

      Update dhcpcd.conf for Static IP
      Open the dhcpcd.conf file for editing:

      nano /etc/dhcpcd.conf
      

      Add the following lines at the end of the file to configure a static IP for wlan0:

      interface wlan0
      static ip_address=192.168.XX.XX/24
      static routers=192.168.XX.1
      static domain_name_servers=8.8.8.8 1.1.1.1
      

      Explanation:

      interface wlan0: Specifies the network interface to configure.
      static ip_address=192.168.XX.XX/24: Assigns the static IP and subnet mask.
      static routers=192.168.XX.1: Sets the gateway address.
      static domain_name_servers=8.8.8.8 1.1.1.1: Configures DNS servers (Google and Cloudflare in this case).
      Save and exit the file.

      Restart dhcpcd Service
      Apply the changes by restarting the dhcpcd service:

      systemctl enable dhcpcd
      systemctl restart dhcpcd
      
      posted in Software Development
      J
      Judoor 0
    • Instruction to set a Static IP for wlan0 voxl2

      Guide to Configure a Static IP Address with systemd-networkd
      I didn't find any guide on how to do it with the voxl2, even the static-ip service seem reserved for eth0 configuration, tell me, if i'm wrong i'll delete this.

      If you want to assign a static IP address to your wireless network interface (using systemd-networkd), follow this simple guide. In this example, we configure the wlan0 interface to use the static IP address 192.168.XX.XX.


      1. Check the Status of systemd-networkd

      Before starting, ensure that systemd-networkd is enabled and running:

      sudo systemctl status systemd-networkd
      

      If the service is not active, enable it:

      sudo systemctl enable systemd-networkd
      sudo systemctl start systemd-networkd
      

      2. Create the Configuration File for wlan0

      1. Navigate to the configuration directory:

        cd /etc/systemd/network/
        
      2. Create a configuration file for your wireless interface (e.g., 10-wlan0.network)

        sudo nano 10-wlan0.network
        
      3. Add the following lines to the file:

        [Match]
        Name=wlan0
        
        [Network]
        Address="192.168.XX.XX"/24
        Gateway="192.168.XX.1"
        DNS=8.8.8.8 1.1.1.1
        

        Explanation:

        • Name=wlan0: Specifies the target interface.
        • Address=192.168.XX.XX/24: Defines the IP address and subnet mask.
        • Gateway=192.168.XX.1: Sets the default gateway.
        • DNS=8.8.8.8 1.1.1.1: Configures the DNS servers.
      4. Save and close the file.


      3. Restart systemd-networkd

      Apply the new configuration by restarting the service:

      sudo systemctl restart systemd-networkd
      

      4. Verify the Configuration

      To verify that the IP address has been assigned to wlan0:

      ip addr show wlan0
      

      You should see the IP address 192.168.XX.XX assigned to the interface.


      5. Enable the Service at Boot

      Ensure that systemd-networkd is enabled to run at every boot:

      sudo systemctl enable systemd-networkd
      

      6. Reboot the System

      To confirm everything works correctly on startup:

      sudo reboot
      

      You have now successfully configured a static IP address for the wlan0 interface using systemd-networkd on your voxl2!

      posted in Software Development
      J
      Judoor 0
    • RE: /tof_depth image conversion problem

      @Alex-Kushleyev thank you alex i'll try that

      posted in ROS
      J
      Judoor 0
    • RE: /tof_depth image conversion problem

      Can you help me with the depth image conversion ?

      posted in ROS
      J
      Judoor 0
    • /tof_depth image conversion problem

      Hello,
      I would like to convert the depth image from mono8 to UC16 while maintaining accurate depth references.
      Currently, I am doing this, but I am ending up with a flat image.

      void depthCallback(const sensor_msgs::ImageConstPtr &msg)
           {
               try
               {
      
                   // Convert the input ROS image to an OpenCV image
                   cv_bridge::CvImagePtr cv_ptr = cv_bridge::toCvCopy(msg, sensor_msgs::image_encodings::MONO8);
      
                   // Create a new image in CV_16UC1 format
                   cv::Mat converted_image;
                   cv_ptr->image.convertTo(converted_image, CV_16UC1, 256.0); // Scale mono8 values to 16-bit
      
                   // Publish the converted image
                   cv_bridge::CvImage out_msg;
                   out_msg.header = msg->header; // Keep the same header
                   out_msg.encoding = sensor_msgs::image_encodings::TYPE_16UC1;
                   out_msg.image = converted_image;
                   depth_pub_.publish(out_msg.toImageMsg());
                   // depth_pub_.publish(depth_msg);
               }
               catch (cv_bridge::Exception &e)
               {
                   ROS_ERROR("CvBridge Error in depthCallback: %s", e.what());
               }
           }
      

      Also, I want to mix it with an RGB image to get an RGBD image, I'm using the rgbdsync nodelet from rtabmap_ros. But I'm unable to make it work. Does someone already did that ?
      Julien

      posted in ROS
      J
      Judoor 0
    • RE: Motor stop functionning on starling 2

      @Jeremy-Schmidt Hi,
      It's resolved now, in the mean time I had a response from the support.
      Have a good day
      Julien

      posted in Starling & Starling 2
      J
      Judoor 0