问:
Cartographer on multi robots simulation not running
I am currently trying to set up a ROS2 foxy multi robots simulation.
However I'm facing an issue, the first instance of cartographer that I launch works. But if I try to launch any more instance, they will not provide anything. I can see that its subscribing to the right topics, but it's not publishing anything on the topics (like submap or tf). And I don't have any error message except occupancy grid complaining of empty submaps.

This is the main launch file, creating all the robots :

```<code>#!/usr/bin/python3

-- coding: utf-8 --
import sys
import os
import random
from ament_index_python.packages import get_package_share_directory, get_package_prefix
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription, SetEnvironmentVariable
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration, TextSubstitution, Command
from launch_ros.actions import Node
from launch_ros.descriptions import ParameterValue
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir
import os.path

spawn_points = [[20.0, -38.0, 0.0], [68.0, -22.0, 0.0], [-14.0, 36.0, 0.0], [70.0, 23.0, 0.0],[58.0, -61.0, 0.0],[40.0, 17.0, 0.0],[-20.0, -35.0, 0.0],[33.0, 44.0, 0.0], [0.0, 0.0, 0.0]]

def gen_robot_list(number_of_robots):

robots = []

for i in range(number_of_robots):
    robot_name = "tb3_"+str(i)
    x_pos = float(i)
    pkg_bc_ros2 = get_package_share_directory('bc_ros2')

    full_path = os.path.join(pkg_bc_ros2, 'robot/', 'turtlebot3_waffle'+str(i)+'.sdf')
    check_file = os.path.isfile(full_path)
    print("Checking if file exists: "+str(check_file)+" "+full_path)
    #if(check_file == False):
    print("Creating new urdf file for robot "+robot_name)
    os.system("cp "+pkg_bc_ros2+"/robot/turtlebot3_waffleX.sdf "+full_path)
    os.system("sed -i 's/tb3_0/"+robot_name+"/g' "+full_path)
    spawn = spawn_points[random.randint(0,spawn_points.__len__()-1)]
    spawn_points.remove(spawn)
    robots.append({'name': robot_name, 'x_pose': spawn[0], 'y_pose':spawn[1], 'z_pose': spawn[2], 'path':full_path})

return robots
def generate_launch_description():

pkg_turtlebot_description = get_package_share_directory('turtlebot3_description')
urdf = os.path.join(pkg_turtlebot_description, 'urdf/', 'turtlebot3_waffle.urdf')

pkg_box_bot_description = get_package_share_directory('box_bot_description')

#assert os.path.exists(urdf), "Thebox_bot.urdf doesnt exist in "+str(urdf)

# Names and poses of the robots
robots = gen_robot_list(2)

# We create the list of spawn robots commands and the robot state publisher
spawn_robots_cmds = []
for robot in robots:
    #spawn_robots_cmds.append(os.environ['ROBOT_NAME'] = robot['name'])
    spawn_robots_cmds.append(
        SetEnvironmentVariable(
            name="ROBOT_NAME",
            value=robot['name']
        )
    )
    spawn_robots_cmds.append(

        Node(
            package='robot_state_publisher',
            executable='robot_state_publisher',
            name='robot_state_publisher',
            output='screen',
            parameters=[{'use_sim_time': True},
                    {'robot_description': ParameterValue(
                        Command(['xacro ', str(urdf)]), value_type=str),
                    'publish_frequency': 50.0, 'frame_prefix':str(robot['name']+"/")

            }],
            arguments=[urdf],

            node_namespace=robot['name'],
            #remappings = [("/joint_states",robot['name']+"/joint_states"),("/tf", robot['name'] + "/tf"),("/tf_static", robot['name'] + "/tf_static")],
        )
    )
    spawn_robots_cmds.append(
        Node(
            package='gazebo_ros',
            executable='spawn_entity.py',
            name='spawn_entity_' + robot['name'],
            output='screen',
            node_namespace=robot['name'],
            arguments=['-entity', robot['name'], '-x', str(robot['x_pose']), '-y', str(robot['y_pose']), '-z', str(robot['z_pose']), '-file', str(robot['path'])],
        )
     )

    spawn_robots_cmds.append(
        Node(
            package='bc_ros2',
            executable='lidar_limiter',
            name='lidar_limiter' + robot['name'],
            output='screen',
            node_namespace=robot['name'],
            arguments=['robot_name', robot['name']],
        )
     )
    spawn_robots_cmds.append(
        IncludeLaunchDescription(
        PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/cartographer.launch.py']),
        launch_arguments={'use_sim_time': 'true'}.items(),
    ),)

# Create the launch description and populate
ld = LaunchDescription()

for spawn_robot_cmd in spawn_robots_cmds:
    ld.add_action(spawn_robot_cmd)

return ld`
</code>```

And this is cartographer.launch.py

```<code># Copyright 2019 Open Source Robotics Foundation, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Author: Darby Lim
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import ThisLaunchFileDir
import os.path

def generate_launch_description():
use_sim_time = LaunchConfiguration('use_sim_time', default='false')
turtlebot3_cartographer_prefix = get_package_share_directory('bc_ros2')
cartographer_config_dir = LaunchConfiguration('cartographer_config_dir', default=os.path.join(
turtlebot3_cartographer_prefix, 'config'))
#configuration_basename = LaunchConfiguration('configuration_basename',
#default='cartographer.lua')

#Checking if the robot already have a config file, if not create it
robot_name = os.environ.get('ROBOT_NAME')
print("________________________Robot name: "+robot_name)
custom_configuration_basename = LaunchConfiguration('configuration_basename',
                                             default=robot_name+'.lua')

cartographer_config_dir_str = get_package_share_directory('bc_ros2')+ '/config'
full_path = cartographer_config_dir_str+'/'+robot_name+'.lua'

check_file = os.path.isfile(full_path)
print("Checking if file exists: "+str(check_file)+" "+full_path)
print("Creating new config file for robot "+robot_name)
os.system("cp "+cartographer_config_dir_str+"/cartographer.lua "+full_path)
os.system("sed -i 's/X/"+robot_name+"/g' "+full_path)

resolution = LaunchConfiguration('resolution', default='0.05')
publish_period_sec = LaunchConfiguration('publish_period_sec', default='1.0')

return LaunchDescription([

    Node(
        package='bc_ros2',
        executable='relative_tf',
        name='relative_tf',
        output='screen',
        node_namespace=robot_name,
        parameters=[{'use_sim_time': use_sim_time,'robot_name': robot_name}],
        # remappings = [("/joint_states","/tb3_0/joint_states"),
        #               ("/tf", "/tb3_0/tf"),
        #               ("/tf_static", "/tb3_0/tf_static")],
    ),

    DeclareLaunchArgument(
        'cartographer_config_dir',
        default_value=cartographer_config_dir,
        description='Full path to config file to load'),
    DeclareLaunchArgument(
        'configuration_basename',
        default_value=custom_configuration_basename,
        description='Name of lua file for cartographer'),
    DeclareLaunchArgument(
        'use_sim_time',
        default_value='true',
        description='Use simulation (Gazebo) clock if true'),

    Node(
        package='cartographer_ros',
        executable='cartographer_node',
        name='cartographer_node',
        output='screen',
        node_namespace=robot_name,
        parameters=[{'use_sim_time': use_sim_time}],
        remappings = [("/odom",robot_name+"/odom_relative"),("/scan",robot_name+"/scan"),],
        # remappings = [("/joint_states","/tb3_0/joint_states"),
        #               ("/tf", "/tb3_0/tf"),
        #               ("/tf_static", "/tb3_0/tf_static")],
        arguments=['-configuration_directory', cartographer_config_dir,
                   '-configuration_basename', custom_configuration_basename]),

    DeclareLaunchArgument(
        'resolution',
        default_value=resolution,
        description='Resolution of a grid cell in the published occupancy grid'),

    DeclareLaunchArgument(
        'publish_period_sec',
        default_value=publish_period_sec,
        description='OccupancyGrid publishing period'),

    IncludeLaunchDescription(
        PythonLaunchDescriptionSource([ThisLaunchFileDir(), '/occupancy_grid.launch.py']),
        launch_arguments={'use_sim_time': use_sim_time, 'resolution': resolution,
                          'publish_period_sec': publish_period_sec, 'robot_name':robot_name}.items(),
    ),

])
`
</code>```

The thing to know is that it worked on monday flawlessly, but not anymore.
Thank you for your attention


问:
Transformation between two coordinate frames (tf)
Problem:

I have a tracepen, a 3D tracked device.

I want to have its pose w.r.t. the world frame. So tf(world,tracepen) is my goal.

I can get its data in ROS as tracepenPose(), but this pose is w.r.t. some unknown tracepenOrig. So I get data of the form tf(tracepenOrig,tracepen) with unknown tracepenOrig.

I want to find a calibration process which gives me the transformation between world and tracepen_Orig tf(world,tracepenOrig).

After having found this, i can apply this calibration transformation to my  tf(tracepenOrig,tracepen)  to obtain tf(world,tracepen)

I have a calibration socket which pose I know relative to the world frame, so I know the tf(world,socket).

When I plug in the tracepen into the calibration socket, the tf(world,tracepenPlugged) must be the same as tf(world,socket).

Solution attempt

I plug in the tracepen to the socket

I publish the pose of the tracepen as tf(tracepenOrig,tracepenPlugged)

I publish the transformation from world to socket as tf(world, socket)

In plugged state, I know that tf(world,tracepenPlugged) must be the same as tf(world,socket)

Or in as homogeneous transformation: matrix_world_tracepenPlugged = matrix_world_socket

I get the total homogeneous transformation from world to tracepenOrigin as

matrix_world_tracepenOrigin = matrix_world_tracepenPlugged@ matrix_tracepenPlugged_tracepenOrigin

From this I can publish the tf(world,tracepenOrigin)

From this I can publish the tracepenPose() as tf(tracepenOrigin, tracepen)

It almost works.
There is a tracepenOrigin frame published, with tracepen as child.
While the tracepen is plugged in, the tracepen frame coincides with the socket frame.

But still:
Moving the tracepen is off.

After calibration everything looks fine.

After moving the socket x+0.2 (tracepen still plugged), the tracepen moves in another direction. It should still be in the socket.
Also rotation of both frames is not the same.

CODE

Only the last two functions are really relevant.

```<code>#!/usr/bin/env python3

import rospy
from geometry_msgs.msg import PoseStamped, TransformStamped, Pose
from std_msgs.msg import Bool, String
import tf2_ros
import tf

import numpy as np
import transforms3d
from transforms import Transforms3DUtils
from ur_msgs.msg import IOStates

#tracepen dependencies
import triad_openvr as triad_openvr
import time

import sys

import tf.transformations

class TracepenNode(object):
  def __init__(self):

    try:
      self.v = triad_openvr.triad_openvr()
    except Exception as ex:
      if (type(ex).__name__ == 'OpenVRError' and ex.args[0] == 'VRInitError_Init_HmdNotFoundPresenceFailed (error number 126)'):
        print('Cannot find the Tracepen.')
        print('Is SteamVR running?')
        print('Is the Tracepen turned on, connected, and paired with SteamVR?')
        print('Are the Lighthouse Base Stations powered and in view of the tracepen?\n\n')
      else:
          rospy.logerr(f"An exception of type {type(ex).__name__} occurred. Arguments:\n{ex.args}")
      quit()

    if len(sys.argv) == 1:
      interval = 1/250
    elif len(sys.argv) == 2:
      interval = 1/float(sys.argv[1])
    else:
      print("Invalid number of arguments")
      interval = False

    self.rpy = PoseStamped()
    self.calibPose = PoseStamped()
    self.rawPose = PoseStamped()

    rospy.loginfo('fmp_tracepen_node: initialized')

    self.tf_broadcaster = tf2_ros.TransformBroadcaster()
    self.tf_buffer = tf2_ros.Buffer()
    self.tf_listener = tf2_ros.TransformListener(self.tf_buffer)
    self.tf_broadcaster = tf2_ros.TransformBroadcaster()

    print(self.waitForTracepen())
    self.calibration()

  def waitForTracepen(self):
    """ Waits for the tracepen to be connected to the system

    """
    tracepenPose = None
    while tracepenPose is None or (tracepenPose.pose.position.x == 0 and tracepenPose.pose.position.y == 0 and tracepenPose.pose.position.z == 0):
          tracepenPose = self.tracepenPose()
          rospy.sleep(0.1)
    return tracepenPose

  def tracepenPose(self):
    """ Get the data from the VR tracker through the steamVR

    rparam position: The position of the tracepen already fixed in the x, y and z directions
    rtype position: geometry_msgs.PoseStamped()
    """
    tracepenpose = self.v.devices["controller_1"].getPoseQuaternion()
    position = PoseStamped()

    try:
      position.pose.position.x = tracepenpose[0] #2
      position.pose.position.y = tracepenpose[1] #0
      position.pose.position.z = tracepenpose[2] #1
      position.pose.orientation.x = tracepenpose[4]
      position.pose.orientation.y = tracepenpose[5]
      position.pose.orientation.z = tracepenpose[6]
      position.pose.orientation.w = tracepenpose[3]
    except:
      rospy.logerr("fmp_tracepen_node: Data not received")

    return position

  def calculate_tf(self, parentFrame, childFrame, pose):
    """
    Calculates a transformation from the "world" frame to a specified child frame,
    based on a given PoseStamped message.

    Args:
        frameName (str): The name of the child frame for the transformation.
        pose (PoseStamped): A PoseStamped message representing the pose of the child
            frame relative to the "world" frame.

    Returns:
        TransformStamped: A TransformStamped message representing the transformation
            from the "world" frame to the child frame.
    """
    transformation = TransformStamped()
    transformation.header.stamp = rospy.Time.now()
    transformation.header.frame_id = parentFrame
    transformation.child_frame_id = childFrame
    transformation.transform.translation = pose.pose.position
    transformation.transform.rotation = pose.pose.orientation
    return transformation

  def matrix_from_tf(self, tf_stamped):
    translation = [tf_stamped.transform.translation.x, tf_stamped.transform.translation.y, tf_stamped.transform.translation.z]
    rotation = [tf_stamped.transform.rotation.x, tf_stamped.transform.rotation.y, tf_stamped.transform.rotation.z, tf_stamped.transform.rotation.w]
    tf_matrix = tf.transformations.translation_matrix(translation) @ tf.transformations.quaternion_matrix(rotation)
    return tf_matrix

  def tf_from_matrix(self, matrix, parent_frame, child_frame):
    translation = tf.transformations.translation_from_matrix(matrix)
    rotation = tf.transformations.quaternion_from_matrix(matrix)
    tf_stamped = TransformStamped()
    tf_stamped.header.stamp = rospy.Time.now()
    tf_stamped.header.frame_id = parent_frame
    tf_stamped.child_frame_id = child_frame
    tf_stamped.transform.translation.x = translation[0]
    tf_stamped.transform.translation.y = translation[1]
    tf_stamped.transform.translation.z = translation[2]
    tf_stamped.transform.rotation.x = rotation[0]
    tf_stamped.transform.rotation.y = rotation[1]
    tf_stamped.transform.rotation.z = rotation[2]
    tf_stamped.transform.rotation.w = rotation[3]
    return tf_stamped

  def calibration(self):
    # I have a tracepen, a 3D tracked device. I can get its Data in ROS as tracepenPose(), but this Pose is w.r.t. some unknown_tracepenOrigin.
    # So i want to find a calibration which transforms the data from this unknown frame to my world frame.

    # Therefore i am looking for the tf(world,tracepenOrigin).

    # The tracepenPose is w.r.t. some unknown tracepenOrigin. The tracepenPose is the transformation from the tracepenOriginin of this frame to the tracepen.
    # As the tracepen is plugged, it is called tracepenPlugged.
    rawPluggedPose = self.tracepenPose()
    tf_tracepenOrigin_tracepenPlugged = self.calculate_tf("tracepenOrigin", "tracepenPlugged", rawPluggedPose)
    self.tf_broadcaster.sendTransform(tf_tracepenOrigin_tracepenPlugged)
    rospy.sleep(0.2)

    # Look up the inverse trafo from tracepenPlugged to tracepenOrigin.
    tf_tracepenPlugged_tracepenOrigin = self.tf_buffer.lookup_transform("tracepenPlugged", "tracepenOrigin",  rospy.Time())
    # Calculate the matrix from this tf.
    matrix_tracepenPlugged_tracepenOrigin = self.matrix_from_tf(tf_tracepenPlugged_tracepenOrigin)

    # I have a calibration socket which Pose i know relative to the world frame, so i know the tf(world,socket).
    tf_world_socket = self.tf_buffer.lookup_transform("world", "socket",  rospy.Time())
    matrix_world_socket = self.matrix_from_tf(tf_world_socket)
    # while plugged, i know that tf(world,tracepenPlugged) must be the same as tf(world,socket).
    # so matrix_world_tracepenPlugged = matrix_world_socket
    matrix_world_tracepenPlugged = matrix_world_socket

    self.matrix_world_tracepenOrigin = matrix_world_tracepenPlugged @ matrix_tracepenPlugged_tracepenOrigin

  def run(self):
      rate = rospy.Rate(10)
      while not rospy.is_shutdown():

        # Get data from OpenVr
        tracepenPose = self.tracepenPose()

        # Publish the transformation from the world frame to the tracepenOrigin frame from the matrix of the calibration process.
        self.tf_world_tracepenOrigin = self.tf_from_matrix(self.matrix_world_tracepenOrigin, "world", "tracepenOrigin")
        self.tf_broadcaster.sendTransform(self.tf_world_tracepenOrigin)

        #Use this tracepenOrigin to publish the tracepen Data.
        tf_tracepenOrigin_tracepen = self.calculate_tf("tracepenOrigin", "tracepen", tracepenPose)
        self.tf_broadcaster.sendTransform(tf_tracepenOrigin_tracepen)

        rate.sleep()

if __name__ == '__main__':
  try:
    rospy.init_node('fmp_tracepen_node', anonymous=True)
    tracepenNodeHandle = TracepenNode()
    tracepenNodeHandle.run()
  except rospy.ROSInterruptException:
    pass
</code>```

The full code is here:
https://github.com/Infraviored/ThesisStuff/blob/main/tracepen_node_v2

ContentLicense: CC BY-SA 4.0


问:
How can I make the iRobot Create turn by the specified angle in Webots?
I am trying to use the iRobot Create in Webots for a project on vacuum cleaning. I am impressed by the fact that Webots contains the create.wbt world as well as default controllers for robot and supervisor by default. Great Work!

However, I noticed that the default turn(angle) function in the create_avoid_obstacles controller turns the robot by less than the specified angle. It is best visible if the angle is set to 90 or 180 degrees. One quick fix I came up with is to multiply the angle by a factor around 1.2 before passing it to the function. But I cannot identify the exact factor needed to produce the desired behavior.

I checked the formulas used in the turn(angle) function, and for me, they seem to be correct. I also checked whether the parameters match the PROTO file of the robot, which seems to be the case as well. Maybe it is a problem with the resolution of the position sensor?

The default controller of iRobot Create is written in C and below is the source code of the turn(angle) function.

```<code>#define WHEEL_RADIUS 0.031
#define AXLE_LENGTH 0.271756
#define ENCODER_RESOLUTION 507.9188
static void turn(double angle) {
  stop();
  double l_offset = wb_position_sensor_get_value(left_position_sensor);
  double r_offset = wb_position_sensor_get_value(right_position_sensor);
  step();
  double neg = (angle < 0.0) ? -1.0 : 1.0;
  wb_motor_set_velocity(left_motor, neg * HALF_SPEED);
  wb_motor_set_velocity(right_motor, -neg * HALF_SPEED);
  double orientation;
  do {
    double l = wb_position_sensor_get_value(left_position_sensor) - l_offset;
    double r = wb_position_sensor_get_value(right_position_sensor) - r_offset;
    double dl = l * WHEEL_RADIUS;                 // distance covered by left wheel in meter
    double dr = r * WHEEL_RADIUS;                 // distance covered by right wheel in meter
    orientation = neg * (dl - dr) / AXLE_LENGTH;  // delta orientation in radian
    step();
  } while (orientation < neg * angle);
  stop();
  step();
}
</code>```

Since my project will ultimately be in Python, I translated the code from C to Python below, but the problem persists in both programming languages.

```<code>WHEEL_RADIUS = 0.031
AXLE_LENGTH = 0.271756
ENCODER_RESOLUTION = 507.9188
def turn(angle):
    stop()
    l_offset = left_position_sensor.getValue()
    r_offset = right_position_sensor.getValue()
    step()
    angle_sign = -1.0 if angle < 0.0 else 1.0
    left_motor.setVelocity(angle_sign * HALF_SPEED)
    right_motor.setVelocity(-angle_sign * HALF_SPEED)
    while True:
        l = left_position_sensor.getValue() - l_offset
        r = right_position_sensor.getValue() - r_offset
        dl = l * WHEEL_RADIUS                                # distance covered by left wheel in meter
        dr = r * WHEEL_RADIUS                                # distance covered by right wheel in meter
        orientation = angle_sign * (dl - dr) / AXLE_LENGTH;  # delta orientation in radian
        step()
        if orientation >= angle_sign * angle:
            break
    stop()
    step()
</code>```

I am thankful for any help on this issue.


问:
How can I model a monorail robot in Webots by importing a Solidwork CAD model of robot?
I am new to Webots. I have not good idea about the considerations what should I consider when import a SolidWork CAD model to the Webots. I have a SolidWork model of robot. But I have not good idea to how should I place the coordinate systems and make relations between movements. Can anyone give some rough idea about the steps I should follow to correctly import a model to Webots?</p>


问:
Connecting MTi-G-710 sensor to PC using RS422 to USB adapter
I tried to connect an MTi-G-710 sensor to PC using this RS422 to USB adapter. I connected the wires from the sensor directly to the terminal block, using this wire color guide.
When I connected it to the PC, it wouldn't recognize my sensor. I also tried:

supplying Vin separately (using both USB power, a 9V battery and a 12V charger)

switching the echo / no echo and no term / term switches on the adapter

checking the continuity of the wires from the terminal to the other end of the cable, one by one

Here are some photos of the connections that I've made:

The sensor wires, connected in the terminal block

The adapter, switched to the 422 mode, with echo disabled and terminal resistance enabled

How can I solve this problem?


问:
Apriltag online generation
Is there any website available for generating custom-sized Apriltag2 or Apriltag3 fiducials? I've come across websites for generating ArUco fiducials(https://chev.me/arucogen/), but I haven't been able to find any for Apriltag fiducials. Has anyone else looked into this and found a easy way?</p>

Title: Apriltag online generation


问:
Pose estimation with hand eye camera detectuion
I have the following configuration:

Where:

e = Robot flange

c = camera

s = Drilling tool

t = target (screw)

b =robot base

The idea is to drill a screw detected by camera. Once I have detected the screw position respect the camera, how could I sendo robot drilling tool (s) to that position? I am not sure the transformation I make in the picture are correct...


问:
Is there a ROS kinetic topic for changing the image on Pepper's screen?
I need a way to change the image displayed in Pepper's screen, I have already launched the bringup and naoqi_driver but there isn't a topic to change it, I have already checked in a lot of forums but I didn't find anything.

P.S.: I don't want to use coreographer.


问:
Is there any reason this VEX RobotC code should NOT engage the motor when the sonar sensor detects something?
I have the following code set up to run a simple test bed -- it's using VEX robotics Cortex 2.0, natural language PLTW. (Yes, I know it's old and now no longer supported, etc. etc. That isn't the point).

```<code>#pragma config(Sensor, dgtl6,  lite,           sensorLEDtoVCC)
#pragma config(Sensor, dgtl7,  Zonar,          sensorSONAR_cm)
#pragma config(Motor,  port1,           Wheel,         tmotorVex393_HBridge, openLoop)
#pragma config(Motor,  port10,          Klaw,          tmotorVex393_HBridge, openLoop)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
  while (1==1)
  {
    while (SensorValue(Zonar) >= 20)
    {
      turnLEDOff(lite);
      stopMotor(Wheel);
    }
    turnLEDOn(lite);
    startMotor(Wheel, 63);
  }
}
</code>```

What is supposed to happen is that when you pass something <20 cm in front of the ultrasonic sensor the wheel should engage and the light go on. In a few cases tho (I built several test beds and have a class doing this to practice input/ outputs) the motor doesn't engage but the light goes on. I thought I might just have to swap the order, but I feel like there is some dead simple thing I am missing here. I am having students essentially copy this code; the point of the exercise is more to just get a feel for writing this stuff and doing the procedural things to get robots working, and use simple while loops. I had similar code for the first part which was just engaging the button (instead of a SensorValue with a sonar I just had a button that was equal to 1 or 0) and that worked fine (you push the button and the motor runs). But I feel like there's a reason this one seems to be a bit wonkier and I wonder if it's something like mis-using while loops or that an if-then-else would be better.

Anyhow any advice would be appreciated.


问:
How to use Moveit2 in ROS2 Humble with my own custom URDF?
I am trying to use Moveit2 with ROS2 Humble. I followed the documentation provided and I was able to recreate the panda robot configurations from the MoveIt Setup Assistant and launching the generated demo.launch.py launch file successfully which proves that my installation is not the problem.
I am writing a URDF file using basic shapes like boxes and cylinders, also I am specifying the visuals, collision and inertial params of the links as well as the limits on the joints and I am being able to see the robot model in RVIZ and control the joints using joint_state_publisher_gui.

My problem is when using MoveIt with this URDF.
When applying the same logic in my workspace with my custom URDF rather than the panda URDF and after making the necessary changes to the other files, I am able to use MoveIt Setup Assistant with my URDF (Although the robot model is not appearing on the right hand side of the MSA) and configure my robot. After building the workspace and launching the generated demo.launch.py launch file, RVIZ is opening but the model cannot be loaded.

GitHub Repository of the Workspace


问:
Developing a robot using mecanum wheel to follow specific path accurately
I am developing a robot using esp32, mecanum wheel, stepper motor and mouse sensor. The robot runs 1000mm forward, 10mm sideways (right side without turning), 1000mm backward, 10mm right and cycle continues. This process must follow 1mm accuracy and repeatability. Two mouse sensor is used, one for distances measurement and another for tilt measurement of robot using basic math's (theta= atan(x/y)) to check whether the robot is facing forward or not. both mouse are fairly calibrated to match the values. Now, the problem I am encountering is that mecanum wheel creates error while running straight and specially side ways. This creates large difference in direction after every run and error gets stacked.</p>


问:
ament_target_dependencies not linking an upstream ament package?

Background

Upstream pkg (called rclcpp_sample) provides a library-a.

Downstream pkg (called rclcpp_child_sample) provides an executable that depends on library-a.

Both are ament-packages (i.e. written within ament framework), to be built with colcon.

To avoid a persistent linker error (very similar to robotics.stackexchange.com#23995 but I wouldn't say the same), the solution I came up with was to target_link_libraries the target that the upstream pkg exports.

```<code>target_link_libraries(${app_derived} rclcpp_sample::rclcpp_sample)
</code>```

Questions

Q1. Why ament_target_dependencies can't link to a resource in another ament package?

  Common error I got was:
```<code># colcon build --packages-select rclcpp_sample rclcpp_child_sample
Starting >>> rclcpp_sample
Finished <<< rclcpp_sample [1.46s]
Starting >>> rclcpp_child_sample
--- stderr: rclcpp_child_sample
/usr/bin/ld: CMakeFiles/app_derived.dir/src/exec.cpp.o: in function `void __gnu_cxx::new_allocator<rclcpp_sample::DerivedModule>::construct<rclcpp_sample::DerivedModule, char const (&) [9]>(rclcpp_sample::DerivedModule*, char const (&) [9])':
exec.cpp:(.text._ZN9__gnu_cxx13new_allocatorIN13rclcpp_sample13DerivedModuleEE9constructIS2_JRA9_KcEEEvPT_DpOT0_[_ZN9__gnu_cxx13new_allocatorIN13rclcpp_sample13DerivedModuleEE9constructIS2_JRA9_KcEEEvPT_DpOT0_]+0x79): undefined reference to `rclcpp_sample::DerivedModule::DerivedModule(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/app_derived.dir/build.make:132: app_derived] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/app_derived.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
---
Failed   <<< rclcpp_child_sample [2.67s, exited with code 2]
</code>```

Q2. Why the exported macro is duplicating the element as rclcpp_sample::rclcpp_sample? rclcpp_sample is the namespace I use but the duplication of it is never defined anywhere in the upstream.

More background

Full code of 2 packages can be seen in prooving_grounds!2 if that's quicker.

Upstream pkg

CMakeLists.txt
```<code>cmake_minimum_required(VERSION 3.8)
project(rclcpp_sample)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# BEGIN: From ROS2 tutorial https://docs.ros.org/en/galactic/Tutorials/Beginner-Client-Libraries/Writing-A-Simple-Cpp-Publisher-And-Subscriber.html
if(NOT CMAKE_CXX_STANDARD)
  set(CMAKE_CXX_STANDARD 17)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()
# END From ROS2 tutorial

set(THIS_PACKAGE_INCLUDE_DEPENDS
  ament_cmake
  rclcpp
)
foreach(Dependency IN ITEMS <span class="math-container">${THIS_PACKAGE_INCLUDE_DEPENDS})
  find_package($</span>{Dependency} REQUIRED)
endforeach()

add_library(<span class="math-container">${PROJECT_NAME} SHARED
  src/impl.cpp
)
target_include_directories(
  $</span>{PROJECT_NAME}
  PUBLIC
    <span class="math-container">$<BUILD_INTERFACE:$</span>{CMAKE_CURRENT_SOURCE_DIR}/include>
    <span class="math-container">$<INSTALL_INTERFACE:include>)
#target_link_libraries($</span>{PROJECT_NAME} <span class="math-container">${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_target_dependencies($</span>{PROJECT_NAME} <span class="math-container">${THIS_PACKAGE_INCLUDE_DEPENDS})
ament_export_include_directories(include)
ament_export_targets($</span>{PROJECT_NAME}Targets HAS_LIBRARY_TARGET)

install(DIRECTORY include/
  DESTINATION include
)
install(
  TARGETS <span class="math-container">${PROJECT_NAME}
  EXPORT $</span>{PROJECT_NAME}Targets
  INCLUDES DESTINATION include
  RUNTIME DESTINATION bin
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
)

ament_package()
</code>```

base.hpp (defines the parent of another class)
```<code>#ifndef RCLCPP_SAMPLE__BASE_HPP_
#define RCLCPP_SAMPLE__BASE_HPP_

#include <ament_index_cpp/get_package_share_directory.hpp>
#include <unistd.h>
#include <rclcpp/rclcpp.hpp>
#include <string>

namespace rclcpp_sample
{

class BaseModules : public rclcpp::Node
{
public:
  BaseModules(const std::string& nodename);
  virtual ~BaseModules();

  virtual bool func_to_be_overridden();
};
}  // namespace rclcpp_sample

#endif  //RCLCPP_SAMPLE__BASE_HPP_
</code>```

child1.hpp
```<code>#ifndef RCLCPP_SAMPLE__CHILD1_HPP_
#define RCLCPP_SAMPLE__CHILD1_HPP_

#include <string>

#include <rclcpp_sample/base.hpp>

namespace rclcpp_sample
{

class DerivedModule : public BaseModules
{
public:
  explicit DerivedModule(const std::string& nodename);
  virtual ~DerivedModule();

  virtual bool func_to_be_overridden();
};
}  // namespace rclcpp_sample

#endif  // RCLCPP_SAMPLE__CHILD1_HPP_
</code>```

impl.cpp
```<code>#include <rclcpp_sample/base.hpp>
#include <rclcpp_sample/child1.hpp>

using namespace rclcpp_sample;

BaseModules::BaseModules(const std::string& nodename) :
    rclcpp::Node(nodename)
{
  RCLCPP_INFO(this->get_logger(), "Initialization.");
}

BaseModules::~BaseModules()
{
  RCLCPP_INFO(this->get_logger(), "Deconstruction.");
}

bool BaseModules::func_to_be_overridden()
{
  return false;
}

DerivedModule::DerivedModule(const std::string& nodename) :
    BaseModules(nodename)
{
  RCLCPP_INFO(get_logger(), "Construtor of DerivedModule class.");
}

DerivedModule::~DerivedModule()
{
}

bool DerivedModule::func_to_be_overridden()
{
  return true;
}
</code>```

Downstream pkg

CMakeLists.txt
```<code>cmake_minimum_required(VERSION 3.8)
project(rclcpp_child_sample)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

set(THIS_PACKAGE_INCLUDE_DEPENDS
  ament_cmake
  rclcpp
  rclcpp_sample
)
foreach(dep IN ITEMS <span class="math-container">${THIS_PACKAGE_INCLUDE_DEPENDS})
  find_package($</span>{dep} REQUIRED)
endforeach()

set(app_derived app_derived)
add_executable(<span class="math-container">${app_derived} src/exec.cpp)
target_link_libraries($</span>{app_derived} rclcpp_sample::rclcpp_sample)
ament_target_dependencies(<span class="math-container">${app_derived} $</span>{THIS_PACKAGE_INCLUDE_DEPENDS})
install(TARGETS <span class="math-container">${app_derived} RUNTIME DESTINATION lib/$</span>{PROJECT_NAME})

ament_package()
</code>```

exec.cpp
```<code>#include <rclcpp/rclcpp.hpp>
#include <string>

#include <rclcpp_sample/base.hpp>
#include <rclcpp_sample/child1.hpp>

int main(int argc, char *argv[])
{
  rclcpp::init(argc, argv);
  auto app = std::make_shared<rclcpp_sample::DerivedModule>("app_execo");
  rclcpp::executors::MultiThreadedExecutor executor;
  executor.add_node(app);
  std::thread([&executor]() { executor.spin(); }).detach();
  RCLCPP_INFO(rclcpp::get_logger("exec_rclcpp_sample"),
              "func_to_be_overridden: %d", app->func_to_be_overridden());
  rclcpp::shutdown();
}
</code>```


问:
VAL language and velocity control of industrial robot
In my bachelor, I programmed CNC machines. Now, working with an Industrial robot arm, I learn that their programming languages are mostly similar. VAL is a typical example, for instance:

```<code>PROGRAM PICKPLACE
  1. MOVE P1
  2. MOVE P2
  3. MOVE P3
  4. CLOSEI 0.00
  5. MOVE P4
  6. MOVE P5
  7. OPENI 0.00
  8. MOVE P1
.END
</code>```

Most of the cases, control of a robot arm is similar to this example. Cleary, move end-effector to a point with a given pose.

But... is there any way that I can control the end-effector (EE) speed? An example is "Move EE to P1 with time duration T1", or "Move EE to P1 with velocity V1" (I could have only seen defining for joint rotational velocity) In other way of speaking, I can command the EE to move from P0 to P1 but cannot control the duration of that traverse which is necessary in cases of EE velocity control

This is the programming manual for my robot mediafire.com/?agl76pi7t7v4hjv. The velocity control I'm talking about is not joint velocity but end-effector velocity. But EE_screw = robot_Jacobian*joint_vel which means to control EE velocity, it resolves in control joint velocity. About the inverse kinematic, I've already programmed a module to solve the robot

the experienced in robotics programming and VAL please help! I've stuck in this problem for months

ContentLicense: CC BY-SA 3.0


问:
Best Way to Sense Rubiks Cube Movements
I was wondering what was, in your opinion, the best way to study the different motions of a Rubiks Cube.
I want to be able to recognize what face moved and in what direction.

Would I be able to get the direction and the face with accelerometers/gyro and if yes how many would I need?
If you have ever used a Leapmotion or Kinect, is it possible to achieve this using those?

Title: Best Way to Sense Rubiks Cube Movements


问:
Connecting Wifi bee with Xbee USB adapter
I started to follow "Get started with the Wifi Bee" tutorial in Wifi bee v1.0 wiki page.
I am using Xbee USB adapter v2.0,Wifi Bee-RN-XV,mini USB cable as listed in Tools needed.
When i conneted the Xbee USB adapter v2 to my computer via mini USB cable Wifi bee didn't light up (but USB adapter did light up). Then i followed all the steps till number 4, which is " Send AT command $$$ to the wifi Bee and it will reply "CMD" to indicate that it enter the command mode properly". When i sent command, it didn't reply anything. I typed other commands like show net and  scan, it didn't reply either.

When i tried Arduino Server example in the wiki page, Wifi bee lighted up. But it gave me some strange ip address with port 200, and when i entered that ip address to my browser address, browser couldn't find the page.

So my question is does Xbee Usb adapter need some extra power sources? Or it just doesn't fit with Wifi Bee? I don't think the problem is with usb cable, 'cause my computer found the device.


问:
Control Arduino firmata with HC-05
I'm using the johnny-five library to control an Arduino Uno running StandardFirmata. I have a HC-05 bluetooth module that I want to use to wirelessly control firmata, but have yet to get it working.

I used http://www.instructables.com/id/Modify-The-HC-05-Bluetooth-Module-Defaults-Using-A/ to configure the board for 57600 baud rate: AT+UART=57600,0,0. I'm able to send various AT commands and read back the results in my serial monitor.

I followed http://www.instructables.com/id/Use-your-android-phone-sensors-on-the-arduino-/?ALLSTEPS to wire up the voltage divider, to make my Arduino's TX operate at 3.3 going into the HC-05's RX.

I've tried running the HC-05 in master, slave, and slave-loop. It only makes a BT connection in slave, which is default.

When I run my johnny-five script, here's the output:

```<code>± node jf-simple.js
1394412173445 Board Connecting...
1394412173447 Board -> Serialport connected
waiting for board to be ready
1394412273448 StandardFirmata A timeout occurred while connecting to the Board.
Please check that you've properly loaded StandardFirmata onto the Arduino
1394412273448 Board Closing: firmata, serialport
</code>```

I've more-than-triple-checked everything. Uploaded firmata many times. Firmata works fine over  USB. Also, I have been able to get this working in the past with an HC-06.

Am I missing something?

What are some good debugging techniques to figure out why it won't connect to Firmata?

Title: Control Arduino firmata with HC-05


问:
Random number generation for Particle Filter
I implemented a bootstrap Particle filter on C++ by reading few Papers and I first implemented a 1D mouse tracker which performed really well. I used normal Gaussian for weighting in this exam.

I extended the algorithm to track face using 2 features of Local motion and HSV 32 bin Histogram. In this example my weighing function becomes the probability of Motion x probability of Histogram. (Is this correct).

Incase if that is correct than I am confused on the resampling function. At the moment my resampling function is as follows:

For each Particle N = 50;

Compute CDF

Generate a random number (via Gaussian) X

Update the particle at index X

Repeat for all N particles.

This is my re-sampling function at the moment. Note: the second step I am using a Random Number via Gaussian distribution for get the index while my weighting function is Probability of Motion and Histogram.

My question is: Should I generate random number using the probability of Motion and Histogram or just the random number via Gaussian is ok.


问:
Click button short vs long button presses Arduino
I am using the clickbutton library from Arduous and am having some problems implementing it. As it stand now the code just runs the servo clockwise and I'm not sure what I did wrong. Basically I want the servo if pressed for a short period of time to move according to an exponential function, and if pressed according to a long period of time to move at a regular pace.</p>

```<code>#include <Servo.h>
#include "ClickButton.h"

Servo myservo; // create servo object to control a servo

// CONSTANTS

// PINS
const int crServo = 12; // sets pin 12 as servo
const int buttonPinCW = 2; // sets pin 2 as button; CW => clockwise => FOCUS FAR
const int buttonPinCC = 3; // sets pin 3 as button; CC => counterclockwise => FOCUS NEAR
const int ledPinB = 4; // sets pin 10 as LED
const int ledPinG = 5; // sets pin 10 as LED
const int ledPinR = 6; // sets pin 10 as LED

const int t = 1;  // slow down

// SERVO PROPERTIES
const int crSpeedDefault = 100; // is the stay still position, motor should not turn
const int crSpeedCW = 107; // turns the motor full speed clockwise
const int crSpeedCC = 87; // turns the motor full speed counter-clockwise

// SET BUTTON STATES
ClickButton buttonCW(buttonPinCW, LOW);
ClickButton buttonCC(buttonPinCC, LOW);

void setup()
{
  myservo.attach(crServo); // attaches the servo on pin 12 to the servo object
  //pinMode (buttonPinCW, INPUT); // sets button as input
  //pinMode (buttonPinCC, INPUT); // sets button as input
  pinMode (ledPinB, OUTPUT); // sets led as output
  pinMode (ledPinG, OUTPUT); // sets led as output
  pinMode (ledPinR, OUTPUT); // sets led as output
  myservo.write(crSpeedDefault); // default servo to crSpeedDefault
  startup();
}

int startup() {
  //blinker(2, ledPinB);
  //blinker(1, ledPinG);
  //blinker(1, ledPinR);
}

void blinker(int count, int pin) {
  for (int x = 0; x < count; x++)
  {
    digitalWrite(pin, HIGH);
    delay(1000);
    digitalWrite(pin, LOW);
    delay(1000);
  }
}

void loop()
{
  buttonCW.Update();
  buttonCC.Update();
  int buttonCWClicks = 0;
  int buttonCCClicks = 0;
  if (buttonCW.clicks != 0) buttonCWClicks = buttonCW.clicks;
  if (buttonCC.clicks != 0) buttonCCClicks = buttonCC.clicks;
  //buttonStateCW = digitalRead(buttonPinCW);
  //buttonStateCC = digitalRead(buttonPinCC);
  // clockwise rotation
  if (buttonCW.depressed == true) {
    if (buttonCWClicks == 1) {
      digitalWrite(ledPinR, HIGH);
      float speed = crSpeedCW;
      Serial.print("CLOCKWISE-ROTATION \n");
      for (int i = 0; i < t * 5; i++) {
        speed += ((float)crSpeedDefault - speed)/ 10;
        Serial.print(speed);
        Serial.print("\n");
        myservo.write((int)speed);
        delay(100);
      }
      myservo.write(crSpeedCW);
    }
    else if (buttonCWClicks == -1) {
      digitalWrite(ledPinR, HIGH);
      myservo.write(crSpeedCW);
    }
  }
  else if (buttonCC.depressed == true) {
    if (buttonCCClicks == 1) {
      digitalWrite(ledPinG, HIGH);
      float speed = crSpeedCC;
      Serial.print("COUNTER-CLOCKWISE-ROTATION \n");
      for (int i = 0; i < t * 5; i++) {
        speed += ((float)crSpeedDefault - speed) / 10;
        Serial.print(speed);
        Serial.print("\n");
        myservo.write((int)speed);
        delay(100);
      }
      myservo.write(crSpeedCC);
    }
    else if (buttonCCClicks == -1) {
      digitalWrite(ledPinR, HIGH);
      myservo.write(crSpeedCW);
    }
  }
  else {
    myservo.write(crSpeedDefault);
    digitalWrite(ledPinR, LOW);
    digitalWrite(ledPinG, LOW);     // turn the LED off by making the voltage LOW
  }
}
</code>```


问:
Simplest way to do object tracking with a 2D range finder sensor?
My current class assignment is to program a robot through a course that includes two moving obstacles – other robots moving at constant speed around a region the one robot must get to. Since the other robots are moving at a constant pace alongside a predictable path, my robot can just stop at the border of the region, wait until the others pass by and then proceed. The robot can use a 2D laser range scanner to sense its surroundings.

Given these restrictions, what is the simplest object tracking algorithm I could use? I am thinking of something along these lines:

Collect two laser readings (2D point clouds) A and B with a suitable time gap between them;

Apply DBSCAN to A and B, producing the cluster lists A' and B';

Generate a list P of pair-wise matches of the clusters in A' and B', maybe using the Hungarian algorithm;

Discard from P any pairings whose difference falls within a threshold;

Calculate direction and magnitude of movements from the distance between the centers of mass of each cluster pair.

The reason for choosing DBSCAN and the Hungarian algorithm is that I already have both implemented and in use elsewhere; and the difference between clusters could be measured as the distance between their centers of mass.

Do you think this solution would work for my problem? Do you have any suggestions on better and/or simpler ways to solve it?


问:
Find the right actuator to control the flow of flour
I'm building a circuit to control the flow of flour. The basic idea is to open that actuator (Possibly valve?) to let a specific amount go through and then close it. The tube should have a diameter of 1cm max.

I wonder what is the right actuator to use? Maybe a valve is the right one? Any other solution? Also, it would be great if you pointed out some suitable actuators that I can buy online.


问:
Actuation of three reciprocating blades via conversion of rotary to linear
Sorry if this is out of robotics, but this seemed the closest.
A motor has to be used to rotate three cranks. They are in the same plane, but each should not run at the same time.

Only one that occupies a central position, corresponding to the motor, should rotate. The discs are mounted in rectangular frame that can be slid to bring the required disc to the central position.

Can anyone suggest a method to achieve this? (Basically coupling and uncoupling the motor shaft from whatever disc is in the centre.)


问:
McKibben artificial muscles and the 400:1 ratio
I was recently reading that those artificial muscles had the highest power/weight ratio while electric motors only have a ratio of less than 100:1. As electrical engineer I have never worked with pneumatics before and do not have a big idea about air pumps.
My question is, how much will this ratio change if we consider an autonomous system.
On one side, the McKibben actuators + air pumps and valves + energy source   and on the other side, electric motors + energy source. As an example, let suppose that somebody found a way to model and control the artificial muscles as good as the electric motors and make two autonomous walking leg models, which one would have a higher resulting power/weight ratio ?</p>


问:
Securing a disc/wheel to a shaft
I am in a situation where I need to secure a 20" wheel made of 3/4" thick MDF (of my own making) onto a 1-1/4" precision-ground steel shaft, and this joint needs to be strong enough to convey a rather large amount of torque, about 575-600 in-lbs, effectively a 5hp motor driving the shaft at 500-600 rpm.

I don't have a milling machine or any metalworking tools, so my preferred option of 'milling flats onto the shaft' is out. My second option was to attempt to increase the surface area of the wheel's bore and then use an appropriate adhesive such as JB Weld.

Is JB weld a suitable solution to this problem or is there a better method of fastening that doesn't involve modifying the steel shaft at all?

Title: Securing a disc/wheel to a shaft


问:
How to connect a servo motor and a crank shaft
I have a standard 5v

I am using the horn it came with it, I mean this piece:

Like the long arm in the middle. Each of its holes are 1mm diameter.

Then I have a 3d printed crankshaft I did:

Its holes are also 1 mm. So while the servo horn is attached to the servo, I attach this crank to the horn in order to lift or lower a small scructure.

What I am not sure is hot to connect these 2 pieces (horn and 3d printed crankshaft). So far I have been using a paper clip, and at both end of it I placed 2 blobs of tin using a soldering iron. This has worked for nearly a year, but today I failed, and I was wondering if there's something more specific for my problem, which seems something common.

I have seen some people use something called Dubro EZ connector, but it seems an overkill, plus it won't have space for my 3D printed piece. Some people seems to use a clevis pin, but I cannot find any with a diameter of less than 1.

So my question is, how can I fix it? What can I put at both ends to stop if from slipping away? I have already tried simple things like simply bending it.


问:
What are some generally accepted lift capacity guidelines for multirotors?
e.g. what general multicopter configurations would be generally accepted as recommendations to lift 0.5kg, 1kg, 2kg, 4kg, etc.

Is there any general correlation between number of motors on a similar sized frame and lift capacity?


问:
EKF localization is approaching singularity. Are my sensors too noisy?
I'm getting this warning from Matlab about Kalman Gain.

```<code>Warning: Matrix is close to singular or badly scaled.
         Results may be inaccurate. RCOND = 9.996841e-19.
</code>```

The problem is coming from high variance of the measurement model. My question is here Does EKF work with high noise in sensor?


问:
Installing OpenNI on Pcduino
Following my previous question about pcduino+kinect, decided to go ahead and buy the pcduino I wish to run my robot with (kinect+pcduino+shields). However I'm having trouble getting started: I tried installing OpenNI, NITE and SensorKinect however OpenNI installation fails (I haven't even gotten to installing NITE and SensorKinect yet so no idea if that would work). I tried a bunch of pointers (here and here). For example the error I get if I follow link 1 is:

ubuntu@ubuntu:~/kinect/OpenNI/Platform/Linux/CreateRedist \$ sudo ./RedistMaker.Arm

Target: Linux-Arm

Version: 1.5.7.10

Num of compile jobs: 0

Building OpenNI...

Common/CommonDefs.mak:36: * Cross-Compilation error. Can't find ARM-J1_CXX and >ARM-J1_STAGING.  Stop.

failed to execute: make PLATFORM=Arm-j1 -C

/home/ubuntu/kinect/OpenNI/Platform/Linux/CreateRedist/../Build clean

/home/ubuntu/kinect/OpenNI/Platform/Linux/CreateRedist/Output/BuildOpenNI_clean.txt

Cleaning Failed!

ubuntu@ubuntu:~/kinect/OpenNI/Platform/Linux/CreateRedist$

After someone suggested it, I tried removing the -mfloat-abi=softfp option but that didn't help. There seems to be some compiling/linking issue due to float types which I'm not able to figure out. In link 1 the author mentions to remove the 'calc_jobs_number()' but that does not work and I get similar error. Also similar problem exists for link 2 above

If I follow link 2, 'make' won't work and will give the following error:

/usr/bin/ld: error: ../../Bin/Arm-Release/libOpenNI.so uses VFP register >arguments, ./Arm-Release/tinyxmlparser.o does not
  /usr/bin/ld: failed to merge target specific data of file ./Arm-Release/tinyxmlparser.o

Another approach would be to use simpleCV instead of OpenNI on pcduino as someone else claims it has worked before. However I've never used simpleCV with Kinect before so unless it's not radically different I prefer using OpenNI.

Any suggestions as to why I might be getting these errors are appreciated. Any other pointers for solving the problem of installing OpenNI on Pcduino would be welcome.

Please let me know if you need more details about anything else.
Thanks in advance

Title: Installing OpenNI on Pcduino


问:
libfreenect simplecv integration?
I installed SimpleCV and libfreenect on pcduino (running lbuntu). I separately verified that simpleCV reads my USB webcam well and libfreenect (glview tutorial) gives me depth and rgb correctly, albeit and a pathetic framerate. What I want is to call cam = Kinect() in simplecv but when I do that, I get the warning "You dont seem to have the freenect library installed. This will make it hard to use a kinect". Although this is a warning I get an error if I then do cam.getDepth(), which says "NameError: global name 'freenect' is not defined".

How do I let simplecv know that I've installed libfreenect?

Title: libfreenect simplecv integration?


问:
How to calculate robot hand positions using Roll, Pitch angles
i want to calculate humanoid robot hand position with given shoulder roll, pitch angles and elbow roll angle.

I'm able to calculate elbow position using rotation matrix which includes shoulder angles.

But i dont know how to calculate hand position using elbow position and elbow roll angle.

Can you propose a method to calculate hand position?


问:
Can active sensor data be fed into an Autodesk Inventor Simulation?
I'd like to drive the position of various components within a virtual assembly based on sensor data being collected in real time from an external device. Does Inventor support such a setup?

The goal is to match the relative movements of the components on screen to the real-world counterpart. For example, a absolute rotary encoder records the current angle of a physical joint and the virtual joint is rotated to match. Is this feasible?

My past searches for information on this have turned up empty; perhaps because I'm using the wrong search terms. Most results point to irrelevant mechanical stress simulations.


问:
Compact design - building from off-the-shelf components
I want to build a small cylindrical arm, with a main 360º angular servo on the longitudinal axis, and a secondary angular servo with variable speed in a trasversal axis that rotates with the main angular one. The secondary needs to receive data and power from a slip ring across the main servo, since it must be able to rotate freely and must not be binded by wirings. The width of the cylindrical arm must be below 0.4 cm

I've reviewed the market for off-the-shelf servos and there are a few that could fit the bill for the main servo, I know where to obtain the slip ring required, but it beats me where to obtain the secondary servo, since the space limitations demand that it is really small (< 0.2 cm) and the smallest I've been able to find on internet are 0.5 cm

Any suggestions are greatly welcome!


问:
BeagleBone uart/spi/i2c latency
There seems to be consensus here that the BeagleBone Black has 1ms+ latency while toggling gpio pins due to the fact that gpio is handled outside of the cpu. Are the uart/i2c/spi lines equaly slow, or are they significantly faster?

I've seen references to people talking to the gpio more directly. Could this decrease uart/i2c/spi latencies as well?

Title: BeagleBone uart/spi/i2c latency


问:
DIY Laser cutter for small Acrylic robot baseplate
Need help to choose desk top, low cost, DIY/High school grade laser cutter for making base plate for DIY robots, about maximum A4 paper size, as this photo.  Idea, comment, advises, even if only partially cover some and not all questions, are welcome.

What power is needed to cut Acrylic 3 to 5mm thick. Many sellers at 40 to 60 watts range. What can these do?

How cut thickness depends on cut speed? To what extend can I choose slow speed to cut thicker sheet.

Does cut thickness depends on color/clear acrylic? It is CO2 laser.

Some units have options, like air blower and honeycomb bottom plate. What are their functions? what options are useful for this case.

Which CAD 2D drawing software is best supported by these range of products?

Apart from main function of cutting flat acrylic plate, some has additional Z axis motor to rise/lower work piece for engrave/photo/line_letter marking on 3D objects. What software is needed to support these 3D operation.


问:
Raspberry Pi finer servo control
I'm usig RPI and Servoblaster to control servos. I've set the --step-size to 2 us, but I'd like to decrease it to 1us. I've tried to set the step-size to 1us, but the Servoblaster displays: Invalid step-size specified.

I've also tried to set the pulse width in micoseconds like echo 1=1140us > /dev/servolaster. It works, but it's unpredictabe (step size is set to 2us):

```<code>echo 1=1140us > /dev/servoblaster - motor starts spinnig
echo 1=1142us > /dev/servoblaster - motor **smoothly** speeds up
echo 1=1144us > /dev/servoblaster - motor's speed has not changed
echo 1=1146us > /dev/servoblaster - motor smoothly speeds up (OK, assume that it can be changed by +/- 4)
BUT:
echo 1=1150us > /dev/servoblaster - motor's speed has not changed - why??
echo 1=1152us > /dev/servoblaster - motor speeds up, but **fastly**
echo 1=1156us > /dev/servoblaster - motor **smoothly** speeds up
</code>```

Motor: Turnigy aerodrive 2830-11, ESC: Turnigy Multistar 30A

Any idea?

Title: Raspberry Pi finer servo control


问:
Quadcopter one beep and blink problem
I have just built my first quadcopter, and have run into a bit of a snag. When I plug in the power, I only get one beep and a red blink from the flight control board, and nothing else happens. When I turn on the controller, however, a red light turns on on the reciever. Otherwise, nothing else happens. From what I can tell, I have plugged in everything correctly, and am not sure how to proceed.

flight control board

Flight Control Board manual (PDF)

ESC's

I do not have a connection from the power distribution board to the flight control board, because I am assuming that it gets its power from the ESC's.

Here is the video I used to figure out how to build a quad.  (side- note about the video: I have not cut the ESC's cords as done in the guide, seemed like a silly step, also I have seen other applications where they were not cut)

I have not updated the firmware on the board, i have put it in out of the box

here is the board's user manual (PDF)

Title: Quadcopter one beep and blink problem


问:
Correcting GPS track with visual odometry (sensor fusion)
I am trying to build low cost and precise outdoor positioning. I explored NS-RAW with RTKLIB - this would be doable but probably will need either a base station to get the correction data for rover or external correction data which may be a hassle. The action radius with own base station is quite limited too. This solution is not really straightforward while you have to deal with either in-house or streamed correction data.

I am wondering whether one would be able to substantially improve the accuracy of an ordinary (uncorrected) GPS+GLONASS device (maybe one found in a common smartphone) with stereo visual odometry. Today's consumer GNSS chips seem to have reasonably stable accuracy in the 5m range. The VISO 2 library has a translation error of about 3% on 500m distance. The idea is to use the visual odometry for "smoothing" the rough GPS track.

The question is how this can be technically done in terms of SW. The input would be two tracks - one from GPS device and the other VISO 2 library. I think I need a kind of filter that will fuse the sensor data to get greater precision.


问:
MPU9150 - Yaw angle Drift
I use MPU9150, also use DCM and Complimentary filter to compute roll, pitch and yaw. However, my Yaw is not so smooth. How can I solve that problem?

I looked at the datasheet of MPU9150, but I didn't see anything related to sampling frequency of magnetometer like gyro and accel.

Title: MPU9150 - Yaw angle Drift


问:
Acceleration formula for a differential steering robot
I have the formulas to derive the RPM's of each wheel from the robot's linear velocity.
Now, I am trying to do the same thing for the acceleration (mainly angular acceleration).
For linear acceleration I am always assuming that the linear velocity of the wheels is the same as the robots when the robot is moving on a straight line...according to physics. Am I right?

But angular acceleration seems more complicated, specially when the robot is following a curved path (not necessarily turning in place).

Any readings or ROS packages that deal with this acceleration issue?

Thanks


问:
Interface multiple I2C slaves to microcontroller
I want to communicate the Tiva C ARM Cortex M4 to sensorhub from TI which has multiple sensors with different I2C addresses such as MPU9150, BMP180, Temperature Sensors...
With a single I2C slave, i can communicate to it successfully, but if my project involves interface Microcontroller with both MPU9150 and BMP180, then i get stuck.
Anybody suggest me the process of commnunication in this case?</p>


问:
Advice on mounting a servo for a nerf sentry gun
I am trying to make a nerf sentry gun to shoot my co workers. I am building it more or less from scratch and have come to the part where I need to come up with plans to assemble it. I am looking for advice on how to mount the mg995 servos to allow them to tilt and pan. I originally thought about having a base with a metal rod through the middle and use a gear to control the pan functionality. The idea is it would mimic a skateboard truck with a gear that would turn the rod through the middle and pivot the shooting mechanism. Another idea was to have the metal plate sit on top of the servo and use one of the attachments to attach it to the top plate. The problems I see behind this is the attachment is just a small piece of plastic and over a short period of time I could see this wearing out especially if the shooting mechanism is not centered perfectly. I also need to come up with a solution to make it tilt but I think I have an idea for this to simply use a rod with a gear to turn the pvc pipe barrel.

Here are the servo's I am using

Sorry if this is the wrong forum for the question but I was unsure where else to look for some expert advice.

EDIT 1

For anyone intersted I found an example of someone doing almost exactly the same thing with blueprints. I am going a slightly simpler / cheaper route and mounting the servo to the bottom of the spinning plate between the lazy susan plate I ordered. This way I don't have to buy the gears which are rather expensive and without the gears it may reduce some of the torque.

http://projectsentrygun.freeforums.org/build-progress-gladiator-ii-paintball-sentry-t130.html


问:
control a robot with pymorse on MORSE simulator question
I am new to Morse and robotics.

This code control the robot by giving the linear and angular velocity.

This is the scene description

```<code>from morse.builder import *
robot = ATRV()
motion = MotionVW()
motion.add_stream('socket')
robot.append(motion)

semanticL = SemanticCamera()
semanticL.translate(x=0.2, y=0.3, z=0.9)
robot.append(semanticL)

semanticR = SemanticCamera()
semanticR.translate(x=0.2, y=-0.3, z=0.9)
robot.append(semanticR)

motion.add_stream('socket')
semanticL.add_stream('socket')
semanticR.add_stream('socket')

env = Environment('land-1/trees')
env.set_camera_location([10.0, -10.0, 10.0])
env.set_camera_rotation([1.0470, 0, 0.7854])
</code>```

and this is the control script

```<code>import pymorse
with pymorse.Morse() as simu:
    simu.robot.motion.publish({"v": 3, "w": -1})
</code>```

The robot moves well. But when I remove the semantic cameras from the scene description the robot do not move. I am confused, they are just sensor, why the robot don't move ?


问:
Hokuyo URG-04LX-UG01 and Mac compatibility issues
I've got my hands on this laser range scanner but seem to have some problem receiving any output from it.

I can't find any guide on  how to set it up on the internet, so I was wondering if it is even possible to set it up for mac or shall i do it using Linux and ROS ?


问:
Survey for Local Navigation
I was wondering if there was a good book or paper that surveys current techniques in local navigation? The earliest one I could find was from 2005 and I was hoping to find something more recent.

I have worked with certain approaches such as the dynamic window approach and the velocity obstacles approach. I'm hoping for some book or paper to give me a broader perspective to the problem of local navigation which I believe has been fairly robustly solved by a number of autonomous driving companies.

Thank you.

Title: Survey for Local Navigation


问:
PID Control Tuning
Im currently designing a robot for my undergraduate project. One of the task of this robot is to follow the wall. For the purpose I'm using a PID control system, where the reference is given from a ultrasonic sensor. So my problem here is im having a hard time tuning the PID. I know i can find the P coefficient pretty easily by plotting the desired set point range vs desired motor output speed. Even then the robot is not so stable, so i though of adding DI part of PID. But how do find out roughly the values of these coefficients without just trying out random values (manual tuning)? Thank you so much. Much appreciated.</p>

Title: PID Control Tuning


问:
Probabilistic Velocity Obstacles
I have been working with the Velocity Obstacles concept. Recently, I came across a probabilistic extension of this and couldn't understand the inner workings.

Source: Recursive Probabilistic Velocity Obstacles for Reflective Navigation http://www.morpha.de/download/publications/FAW_ASER03_Kluge.pdf

What does the equation at the bottom and the top mean? Vij is the relative velocity of agent i to agent j. ri & ci and rj & cj are their respective radius and centers.

Update:
What does inf(ri + rj) and sup(ri + rj) mean? Does it mean that I should define a function that goes from 1 to 0 from inf to sup? And if not, then how do I calculate the value of PCC at any given point?

Title: Probabilistic Velocity Obstacles


问:
RNN instead of a PID controller
I am building a drone using the raspberry pi and I am using 6*PID controllers to control the speed and the value for each angle, can I use a recurrent neural network (RNN) or other neural network to stabilize the angles. If so what can the training data be? What type of neural network (NN) is best suited for this kind of application?</p>

Title: RNN instead of a PID controller


问:
AHRS Algorithm Question
As far as i understand, AHRS use orientation reference vectors to detect orientation error. And we can use magnetometer to correct yaw drift. But i see from my ak895 magnetometer that the data is not so stable, it kind of fluctuates continuously.

How can we use this data for AHRS algorithm?

Title: AHRS Algorithm Question


问:
Choosing motor characteristics
I have just sized the DC motors I want to use (corresponding to my robot and its intended applications - my figures include a 50% uncertainty factor to account for friction in reducers and other losses). Now I need to actually choose the exact motors I want to buy from the manufacturer (I am targeting maxon motors as I am not an expert and want no problem). I have a few down to earth questions about linking the mechanical needs to the electrical characteristics:

Maxon states a "nominal voltage" in the characteristic sheets. Is that the voltage you should apply to the motor? This may be a dumb question but I have followed the full maxon e-learning course and read about other tutorials on the web and I could not find this information anywhere. Can anyone who knows about motors confirm?

As far as I understand, the nominal torque corresponds to the maximum torque the motor can sustain continuously. So I guess, as a rule of thumb, I should find a motor with a nominal torque = my max torque (after reduction), or around. Right?

Also I chose a motor reference (310005 found here) which has a stated power of 60W, as the nominal voltage is 12V, I was expecting to have a nominal current of 5A, but it states 4A. Where am I wrong?

The motor I chose has nominal speed = 7630rpm - nominal torque = 51.6mNm. My needs are max speed = 50.42rpm / max torque = 10620 mNm. This means a reduction factor of 151 for speed and 206 for torque. Should I choose a gear closer to 151 or 206?

What is the "rated torque" mentioned when choosing a gear? I know my input torque (torque on the motor side) and my output torque (torque on the system side), does that correspond to any of these two?

I have followed some theoretical and practical courses on the web but I find it hard to find answers to my down to earth question...

Thanks,

Antoine.

Title: Choosing motor characteristics


问:
How to change the orientation of an object w.r.t a scene?
I am trying to localize an object in a point cloud using ROS, PCL. For that I capture the scene and model using Asus xtion pro sensor. I use RGBDSLAMv2 for capturing the model.

Then I use ICP (nonlinear version) to find the transform from the model to each cluster of the cloud. The cluster with the lowest score is chosen as the best matching cluster.

Pseudocode:

```<code>Segment the point cloud into different clusters. ([Using euclidean clustering][3])
for each cluster i
     Source: 3dmodel. Target: current cluster
     Perform [ICP (nonlinear version)][2].
     score[i] = icp.getFitnessScore()
     T[i] = icp.getFinalTransformation()
end for
matchingCluster = cluster with minimum score
finalT = T[matchingCluster]
</code>```

However, I am not able to find the correct transformation.

Here are the screenshots of the results I got:

The red colored object is the transformed model overlayed onto the scene. The yellow object represents the original model in the coordinate system of the scene.

Now, my concern is why there is no proper transformation? Am I missing something?

Second, I see that the object model and scene are in different coordinate system. So the model appears inverted when presented in the scene's coordinate system. Is there a way in which I can transform the model upright before running ICP?

Thanks :)


问:
Arduino Lightsensor Blocking Code
I have a GY-31 Light sensor and I am trying to make a skittle sorting machine. There is a little wheel skittles can drop into then they are turn to 90 degrees read by the light sensor then dropped out the bottom. The problem is the code seems to get stuck after reading the light sensor (it still flows through but won't execute the moving of the servo). As soon as I take out the ReadSensor line the servo works like normal. Do I have to dispose of the Color Sensor some how?</p>

```<code>#include <Servo.h>
#include <MD_TCS230.h>
#include <FreqCount.h>

#define  S2_OUT  2
#define  S3_OUT  3
MD_TCS230  CS(S2_OUT, S3_OUT);

Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created

void setup()
{
  myservo.attach(11);  // attaches the servo on pin 9 to the servo object
  Serial.begin(57600);
  Serial.println("[TCS230 Simple BLOCKING Example]");
  Serial.println("Move the sensor to different color to see the value");
  Serial.println("Note: These values are being read in without sensor calibration");
  Serial.println("and are likely to be far from reality");

  CS.begin();
  CS.setFilter(TCS230_RGB_X);
  CS.setFrequency(TCS230_FREQ_HI);
  CS.setSampling(100);
}

 void readSensor()
{
  uint32_t v;
  v = CS.readSingle();
  Serial.print("Simple value = ");
  Serial.println(CS.readSingle());

}

void loop()
{
  Serial.println("Start");
  myservo.write(0);
  delay(1000);
  myservo.write(90);
  delay(1000);
 readSensor();
  myservo.write(180);
  delay(1000);
}
</code>```

Title: Arduino Lightsensor Blocking Code


问:
How to make a robot following a virtual eight figure pattern without using microcontrollers?
The robot should go around 2 boxes and stop at the starting point after tracing a 8 figure pattern. With micro-controllers, i guess it can be easily done using sensors or navigation algorithms. Please suggest how can be one made without them.</p>


问:
Chassis materials for Hobby-weight (5.44Kg) battle robot
I have sorted out all the internals for my robot (drive systems and weaponry) and now I need to put it all together in a chassis which will be about 40 cm wide by 35 cm long by 7 cm high. I have examined different options, including Perspex, Acrylic and Polycarbonate as well as aluminum, in a number of thicknesses. However I have excluded Perspex and Acrylic because, unlike Polycarbonate, they tend to shatter if bent.

So now it is down to Polycarbonate and/or Aluminum.

So here is the problem, up for discussion or a solution.. but first I must point out (a) that the overall weight limitation in turn imposes chassis weight limitations (b) that this is my first ever robot wars entry, and (c) I am likely to be up against cutting and tearing devices.

I already have the weights of the different materials in hand, so all of the following options are possible in terms of weight.

Option 1: Do it all in 6 mm Polycarbonate.

Option 2: Combine a thin (2 mm aluminum) outer shell with an underlying 3 mm polycarbonate one to get a good mix of the properties of both (rigid and hard, thin and heavy + flexible and strong, thick and light.

Option 3: As Option 2 but the other way round - 3mm Polycarbonate on the outside and 2 mm Aluminum on the inside.

Should I go with Option 1, 2, 3 or something else altogether that maybe I am not seeing? (Note: having it all in 3 mm aluminum is not possible as it will be too heavy - I checked)

Should I have the aluminum on the outside as a heavy duty shell or on the inside as a "last resort" layer? (Note: In my mind these layers would be held together with nuts and bolts with washers to spread any impact loads; but even here should the nuts and bolts be tightened for rigidity or left slightly loose for impact absorption?)

Any advice, especially from people seasoned in the art of robot warfare please?


问:
Does anyone have a working example of using Qt to communicate with NXT?
I'm stumped. I've been looking through all of the Qt classes and I'm so completely and utterly lost. There are only three examples of bluetooth use in Qt, but none of them work for me. I just need a program that can talk with NXT and analyze an image from a webcam.

Has anybody gotten this to work before?


问:
Keeping two wheeled wall following robot straight
I have a two-wheeled (two DC motors) robot that needs to follow the wall beside the robot.

The issue is that the DC motors spin at different rates (because they are not identical, of course), so the robot does not go straight when the same voltage is provided to each motor.

How can I use IR distance sensors (and op-amps) to keep the distance from the wall constant?

(the robot must travel parallel to the wall)


问:
Wiring 5V sensors to Beaglebone Black
Is there a "cape" to make wiring sensors into a Beaglebone Black easier?

Whenever I read some guide for wiring a sensor into the Beaglebone (like this one) it always recommends attaching wires directly to GND, +V and signal pins, which is horribly messy and unmaintainable. Even for small projects, you end up having several wires connected to the same GND/5V+ pins, so if you need to replace or repair something, you end up disrupting the wiring for every other component in your project.

Most Arduino guides assume this bad practice too, but at least I've found various "GVS" shields to help organize groups of GND/5V/Signal pins so I can attach individual sensor cables.

Is there anything similar for the Beaglebone? I can't find anything appropriate Googling "breakout" or "IO" cape. I could only find one GVS cape, but it's less than ideal, since it only exposes 5 5V GPIO pins, and everything else it exposes as 3.3V or 1.8V which are incompatible with most peripherals.

Title: Wiring 5V sensors to Beaglebone Black


问:
APM Planner on Linux/Ubuntu "open from file" not working
I can't open parameter list with APM Planner.

Moreover I can't find anyone with same problem.
I run it on Ubuntu/trusty 14.04

It does not see files with any extensions including param and txt downloaded from internet or created with my version of APM Planner.

Any ideas how can I fix it?

PS ls -la from terminal

```<code>user@laptop:~/apmplanner2/parameters$ ls -la
total 16
drwxrwxr-x 2 user user 4096 Dec  9 12:57 .
drwxrwxr-x 7 user user 4096 Dec  9 21:05 ..
-rw-rw-r-- 1 user user 6881 Dec  9 12:57 paramter.param
</code>```

I have param, txt files in Downloads folder also.

PS


问:
Defining a trajectory for a quadrotor
I' m looking for a trajectory generator (the algorithm doesn't matter, since I m going to write it using C++ ) that generates a trajectory (a parametric curve in space) defined point by point which is going lately to be feed into my quadrotor drivers.

I'm honest: I don't know where to start.

Reading the following interesting answer. But the problem here is: the trajectory has a PD controller with it. My quadrotor should take just a parametric curve as input.

OMPL: this library seems very powerful and interesting. It let the user to define a planner which many different algorithms. The problem is that it is not well documented, good examples and explanations are missing and till now I could'nt find anything related to quadrotors, which does use that library. There is an example for a quadrotor, which doesn't find my expectations and I cannot figure out, how to implement it in my package. I don't want just copy and paste code that I don't understand.

B-Spline and Bezier Curve...and the whole family of parametric curves. I found very interesting libraries in internet that implement those algorithm directly C++. The problem here is: I can define some points in space, generate a spline that contains them and interpolate points for the PID controller in the quadrotor. The basic idea is like a dog chasing a rabbit. A point is generated from the start point of the spline and regularly sent to the quadrotor. The latter flies behind the point, trying to reach it until a goal point has been reached. What is the problem here?!? In this case I can only generate a curve based on geometric properties and not considering the dynamic and the kinematic of the quadrotor (which I would consider for a future project). The rabbit runs and has a tighter curve radius than the dog, which could result in a strange behavior of the quadrotor.

I'd like same good tips to point to the right direction.

Which kind of trajectory planner are usually developed fr such an application?

Thanks!
Regards

Title: Defining a trajectory for a quadrotor


问:
How to send a new Mavlink message from Ardupilot?
I'm trying to add a new message to the MAVLink interface. Following this page, there are the steps I took:

Added the message to ardupilotmega.xml. Right at the end of the file:

```<code><message name="TESTING_TESTING_TESTING" id="182">
  <description>A testing message</description>
  <field type="int16_t" name="placeholder">Does nothing. Simply a placeholder</field>
</message>
</code>```

Regenerated the mavlink messages headers using ./libraries/GCS_MAVLink/generate.sh. It worked okay and the new headers appeared.

Then I added a function to the GCS class to make sure I'm sending on the right channel:

```<code>void GCS_MAVLINK::send_testing_testing_testing()
{
    mavlink_msg_testing_testing_testing_send(chan, 0);
}
</code>```

Now it's time to send the message, I added my own function to the scheduler (on last priority). I made sure the function is called by sending text first and seeing it on the mission planner console. Here is the function I added:

```<code>static void a_testing_loop(void)
{
    for (uint8_t i=0; i<num_gcs; i++)
    {
        if (gcs[i].initialised)
        {
            // gcs[i].send_text_P(SEVERITY_HIGH,PSTR("Testing String"));
            gcs[i].send_testing_testing_testing();
        }
    }
}
</code>```

My message, however, isn't received on the mission planner end. It might have been received and ignored by the mission planner, but anyway it doesn't appear on the console window (even with 'Mavlink Message Debug' on)

Is there configuration to be made to the Mission Planner for it to receive new messages? Or am I sending the message wrong?

Also, is there a way to filter out messages from the console when using 'Mavlink debug mode'?

I'm using SITL for testing

(I don't have enough reputation - But this should be under the tag 'mavlink')


问:
SLAM Goal Babbling
I am struggling to find good links to the use of goal babbling in SLAM applications. Has this technique been used as a method for optimizing movement in a SLAM environment?</p>

Title: SLAM Goal Babbling


问:
Jacobian Matrix of 6DOF Body (with IMU)
I am trying to derive the analytical Jacobian for a system that is essentially the equations of motion of a body (6 degrees of freedom) with gyro and accelerometer measurements.
This is part of an Extended Kalman Filter.

The system state is given by:
$
\mathbf{x} = \left(
\begin{array}{c}
\mathbf{q}\\
\mathbf{b_\omega}\\
\mathbf{v}\\
\mathbf{b_a}\\
\mathbf{p}\\
\end{array}
\right)
$

where $q$ is the quaternion orientation of the body expressed in the global frame, $b_\omega$ and $b_a$ are the biases in the gyro and accelerometer respectively (expressed in the body frame) and $v$ and $p$ are the velocity and position of the body expressed in the global frame. All vectors are [3x1] except $q$ which is [4x1] in $[w,x,y,z]^\top$ format, and $R$ (below) which is [3x3].

The equations of motion $\frac{dx}{dt}=\dot{x}$ (t is time) are:
$$
\dot{\mathbf{q}} = \frac{1}{2}\mathbf{q} \otimes
\left(
\begin{array}{c}
0\\
\hat{\omega}\\
\end{array}
\right) \\
\dot{\mathbf{b_\omega}} = 0 \\
\dot{\mathbf{v}} = R^\top (\hat{\mathbf{a}} + [\hat{\mathbf{\omega}}\times]R \mathbf{v})+ g \\
\dot{\mathbf{b_a}} = 0 \\
\dot{\mathbf{p}} = \mathbf{v}
$$
Second-order terms are ignored. $\hat{a} = a - b_a$ and $\hat{\omega} = \omega - b_\omega$ are the corrected accelerometer and gyro biases ($a$ and $\omega$ are known) and are expressed in the body frame. $R$ is the rotation matrix (DCM) formed from $q$ and $g$ is the gravity vector $[0,0,9.81]^\top$. These equations have been validated against an aerospace engineering software library.

I need the jacobian $F = \frac{d\dot{x}}{dx}$ but I cannot find this jacobian in any texts (I do find the error-state jacobian eg this paper).
I am struggling with doing this myself because I don't know how to handle the quaternion norm constraints. I also am concerned about the validity of a solution given through numerical differentiation.

Any help or explanation would be greatly appreciated. This is going towards an open-source robot localisation project.

Title: Jacobian Matrix of 6DOF Body (with IMU)


问:
Fusion of GNSS position data and prefused 9-dof AHRS data
Bosch, FreeScale, InvenSense, ST and maybe others are releasing 9-dof AHRS platforms containing their own fusion software and outputting filtered/sane/fused data (attitude as quaternion and linear acceleration).

I would like to use these for the quality of their respective company fusion algorithm. And would like to merge GNSS position and velocity data to it.

I have found multiple examples of heavy (> 20) states Kalman filters merging raw 9-dof IMU data and GNSS position/velocity.

But I have a hard time finding a computationally lighter version of GPS+AHRS fusion as these new 9-dof AHRS already fuse IMU raw data themselves and this process should'nt be done twice.

Would you maybe have pointers on the algorithm(s) or type of filter to use ? Thank you.


问:
choose ZigBee modules for full wireless mesh
What is the most common ZigBee IP Modules to create full wireless mesh mode?
I know that it should be 1) coordinator and 2) router to create full-mesh

But I am interesting about what kind of modules it would be better to buy by comparing price, quality and tutorial material. It would be graet if you know some ZigBee modules based on ARM(Cortex) or Atmel MCUs and if you have some additional tutorial materials to control those modules and  understand it.

I am looking for ZigBee modules only, but NOT XBee!!!
because they have difference in organization of network.
Ex.:
First of all, ZigBee Mesh can create own zones to control devices.
but in Xbee Mesh which from Digi Comany can create only full mesh and only one big or huge zone to control devices.

Secondly, ZigBee modules - AES encryption. Can lock down network and prevent other nodes from joining.

Xbee - AES encryption.** and it is coming soon...


问:
Cheap wheeled robot without tether (does not need to be programable)
I am looking for cheap wheeled robot that can be controlled remotely. I do not really care about how (RF, Bluetooth, WiFi, IR, other?), as long as I can control around 10 robots without interference in a small arena (they are always in the line of sight).

I would like to emphasize that I do not need them to be programmable and it is important that they are cheap.


问:
Ros, iai_kinect2 issues
here is what I did on Ubuntu 14.04 LTS running on a Toshiba Satellite, intel i7, nvidia with usb 3.0 and 2.0 ports.

1, 2, 3 refer to scripts found here

Setup ros by running this install-ros.sh script

Setup opencv by running this install-opencv.sh script

Setup PCL by running this install-pcl.sh script

Installed  libfreenect2 via the instructions at the master branch

Made the changes and installed

Cloned the repository into an empty catkin workspace

Sourced the respective setup.zsh files from my /opt/ros/... and from the devel/ folders.

At this point, I have encountered no issues

I tried running:

```<code>rosrun kinect2_bridge kinect2_bridge
</code>```

and I get the following message:

```<code>[ERROR] [1424391698.413758209]: [registerPublisher] Failed to contact master at [localhost:11311].  Retrying..
</code>```

So I assume I need to run roscore or something like that. So if I run:

```<code>roscore
</code>```

in one terminal and:

```<code>rosrun kinect2_bridge kinect2_bridge
</code>```

in another terminal, I get the following segmentation fault:

```<code>[ERROR] [1424393345.496836066]: [registerPublisher] Failed to contact master at [localhost:11311].  Retrying...
[ INFO] [1424393446.243884489]: Connected to master at [localhost:11311]
parameter:
        base_name: kinect2
           sensor:
        fps_limit: -1
       calib_path: /home/parthmehrotra/catkin_ws/src/iai_kinect2/kinect2_bridge/data/
          use_png: false
     jpeg_quality: 90
        png_level: 1
     depth_method: opengl
     depth_device: -1
       reg_method: default
       reg_devive: -1
        max_depth: 12
        min_depth: 0.1
       queue_size: 2
 bilateral_filter: true
edge_aware_filter: true
       publish_tf: false
     base_name_tf: kinect2
   worker_threads: 4

[1]    2679 segmentation fault (core dumped)  rosrun kinect2_bridge kinect2_bridge
</code>```

I must be overlooking something really trivial. Thanks for taking the time to help me.

Title: Ros, iai_kinect2 issues


问:
Microcontroller for running Linux RTAI
I'm a beginner in Robotics.

I'd like to ask what are the minimum/recommended specs for a microcontroller to run a real-time system such as Linux RTAI?

What is the popular microcontroller for running Linux RTAI?

Thank you.

Title: Microcontroller for running Linux RTAI


问:
Heavy omnidirectional platform suspension
I'm planning to build an omnidirectional platform that will support about 180kg robotic arm. The platform will be equipped in meccanum wheels. I would like to have some kind of suspension to avoid wheels loosing contact with the floor on small bumps (let's say 2cm).

The first suspension type I thought about was rocker bogie type, but I'm afraid, that changes of arm center of mass during its movement will introduce too much stress on rocker bogie mechanism.

What other choices would you recommend? Or maybe rocker bogie will be fine after all?


问:
Angles in a Rocker bogie system
How do you select the following two angles in the design of a Rocker bogie system:

Angle between two arms of the main rocker, and;

Angle between two arms in the bogie.

Title: Angles in a Rocker bogie system


问:
Unilateral Torque Constraint on the foot-ground interface
I was studying the basics of legged locomotion and came across the unilateral force and torque constraints at the foot-ground interface.

I understood the implication of the unilateral constraint on the force ( the ground can only push the foot but not pull it) but I am unable to understand what does the unilateral torque constraint translate into physically in this case. Can anyone clarify it?


问:
Is motor current proportional to thrust?
So I was making sure my circuit for an airboat I was working on was safe. And checking a motor, it has 35 amps max current running 11.1v at 1000. (However my ESC has a 30 current, 40 burst amps).

The recommended tested prop for this is a 11x9 3-blade and runs the motor at 20 amps. Doing some quick calculations via on online calculator, it appears to give a value of 5.4lbs of force (way off to the 2.65 lbs measured, but regardless...). When I type in a prop I want (13x6) it gives a thrust value of 7.53 .

Now, if the motor current is proportional to the thrust, 5.4 lbs / 20 amps = 7.53 / running amps. And therefore the amount of amps the prop would be, in theory a little less than 30 if this is indeed the case. Thus safe for my application.

This would also make sense in physics terms as Power = Current*Voltage which is proportional to thrust, but just need to make sure.

So does this thought process work for choosing a prop? My device will  be doing very short runs (less than 25 seconds), so near-boundaries should be safe...


问:
Can't connect to BeagleBone Webserver?
I'm following this getting started tutorial, connected the board to USB and it's detected as mass storage, got the driver installed (Win 64), and at the third step I wasn't able to connect to BeagleBone webserver at 192.168.7.2, anything I did wrong? Please help.

Here is some troubleshooting info from Getting Started page, I've followed them all. I'm using Chrome, tried the node-webkit based application, not in a Virtual Machine, not using SSH just trying to access the webserver.

Troubleshooting

Do not use Internet Explorer.

One option to browse your board is to use this node-webkit based
  application (currently limited to Windows machines):
  beaglebone-getting-started.zip.

Virtual machines are not recommended when using the direct USB
  connection. It is recommended you use only network connections to your
  board if you are using a virtual machine.

When using 'ssh' with the provided image, the username is 'root' and
  the password is blank.

Visit beagleboard.org/support for additional debugging tips.

UPDATE:
- I tried to install Ubuntu on my machine and connect the BeagleBone, it need not any driver and I can immediately access the webserver after ejecting the mass storage, enabling the 'USB-to-Ethernet Interface'. However in Windows ejecting the mass storage still does nothing. Still trying to make it connect in Windows.

Title: Can't connect to BeagleBone Webserver?


问:
Datalogging from Arduino Mega to Dropbox
I have an Arduino Mega board and the Adafruit Ultimate GPS Logger + GPS module shield. I have these two connected together using headers and have the entire thing mounted on my drone. Currently, I have a code that I found online and modified slightly to get GPS coordinates in NMEA format and parse them for the information I actually want. I can store these in an SD card.

The thing is, I want to use the Arduino GSM shield to somehow send this data, either from the SD card or directly, to a folder in Dropbox. I have no idea how to do that, if it's possible at all. I just started working with Arduino about a month ago, so I apologize if my question sounds particularly noob-ish.

Could anyone on this forum at least guide me on how to approach this problem? Thanks!


问:
Depth of view for a hypercatadioptric camera
I am trying to determine the depth of view for a hypercatadioptric camera (camera lens system and a hyperbolic mirror) based on 1.

The following illustration seems pretty clear. For an image point $p$, we are looking for a virtual point $p_u$, given the parameters of the optical system.

I have troubles finding the right equations in the paper, though. There is the distribution of a virtual point which seems to be connected to $p_u$, but is not defined anywhere.

My goal is to replicate the diagrams they have later in the paper, like e.g. this one:

Which for a mirror (blue) gives the virtual image points of the scene (red).
I would like to calculate the depth of view, so the area at which the image blur is below a threshold.

1 Zhang, S., Zenou, E.: Optical approach of a hypercatadioptric system depth of
field. In: 10th International Conference on Information Sciences, Signal Processing
and their Applications


问:
How to select the parameters of the Sliding Mode Control of a Robotic Arm?
I working on sliding mode control (SMC) of a 4 DoF manipulator, I don't know
how to select the discontinuity gain matrix, $ K$ , the surface constant (the diagonal gain matrix $\Lambda$  components).</p>


问:
accelerate a stepper using arduino AccelStepper starting with a pre-defined speed
I've read the AccelStepper documentation on airspayce.com and it seems to be not possible to accelerate a stepper starting with a speed greater 0. Acceleration always starts from speed=0, I tried it with several variations of the code below...

```<code>#include <AccelStepper.h>
int onOffPin = 9;

AccelStepper stepper(AccelStepper::DRIVER, 2, 10);

void setup()
{
   stepper.setMaxSpeed(1000);
   stepper.setSpeed(200);
   stepper.setAcceleration(100);
}

void loop()
{
    //turn motor on
    digitalWrite( onOffPin, HIGH );

    // go forwards
    digitalWrite( onOffPin, HIGH );
    stepper.move(1300);
    stepper.runToPosition(); // stepper shall start from speed 200, but it starts from speed 0;

    // Now go backwards
    stepper.move(-1300);
    stepper.runToPosition();

    //turn motor off
    digitalWrite( onOffPin, LOW );
    delay(2000);
}
</code>```

I also tried to set the speed in the library's method void AccelStepper::computeNewSpeed() directly, but I'm not that good in c++ and don't get it to work.

Anybody any ideas?

UPDATE

I tried to write some custom code in AccelStepper.cpp's method void AccelStepper::computeNewSpeed()
My idea was to set the speed manually during acceleration/deceleration if the speed is below my intended value. At first I thought it couldn't be a big deal, but now I see that my cpp skills seems to be not good enough or I don't understand the library quite well.

I tried

```<code>void AccelStepper::computeNewSpeed()
{
    long distanceTo = distanceToGo(); // +ve is clockwise from curent location
    long stepsToStop = (long)((_speed * _speed) / (2.0 * _acceleration)); // Equation 16

    //now here goes my modification
    if (_speed < 200.0 && _speed >= 0 ){
       setSpeed(200.0);
    }
    //I did no modification below this comment
</code>```

This results in a very slow stepper movement..


问:
Using accelorometer and gyroscope to get velocity, spin & flightpath of a ball in projectile motion
I'm working on a project to make a SmartBall that can detect the velocity(km/h) , spin(degrees per second) and flightpath(trajectory) of the ball using Intel Edison with the 9DOF block (LSM9DS0 : 3-axis accelerometer, 3-axis gyroscope, and 3-axis magnetometer) & the battery block, I'm reading values from the 9DOF block by RTIMULib(Library for IMU chips). I've been working on integrating the acceleration data from the accelorometer to get the velocity then get the position, I know that this method is not really accurate as the integration error cumulate very fast but I rely on that my calculations will be done in a very short time (about 3 seconds) then i re-calculate again from the beginning after every kick so that error doesn't cumulate hardly, Also i only need an acceptable accuracy not a very high one. I discovered then that i'm dealing with projectile motion(ball kicking), so after considering this & searching in projectile motion equations i found that i must know the initial velocity and the angle of projection(theta) to be able to get my requirements. my problem that I don't know how to get any of these , I tried different approaches like getting the horizontal distance & getting the height to get their resultant(using pythagoras) then get the angle(assuming it's a right angle) in a very small time at the beggining of the projection , but i still couldn't get the height. The gyroscope outputs roll, pitch & yaw angles related to the sensor orientation but i'm still not using this as i'm assuming that the sensor will be fixed inside the ball so it's orientation will not be the same as the projection angle.Now What I really want is any approach/idea on how to get velocity & flightPath of a projectile using accelorometer and gyroscope data. Hope I made it clear , Any help on how to get my requirements is really appreciated, Thanks so much.</p>


问:
(Dynamixel) Inverse rotation direction
I'm wondering if there's a feature to "flip" the rotation direction with Dynamixel (I'm using MX-106). For example, if I give +1.57 to the motor, then it interprets it as -1.57. And the other way around.

I'm using its ROS driver package that doesn't seem to explicitly claim that there's a feature to do this, although there is a question where a user reported he was able to do this from source code. But I failed to replicate. So I first wanted to ask about the capability of the device itself since I don't know if the limitation comes from the Dynamixel device or from ROS driver.

Thank you.

(UPDATE) Usecase of mine is that I have multiple robots where the direction of how Dynamixel is attached is different per robot, and ideally like to flip the motor's direction at driver's level so that I can keep using the same controller software.

Title: (Dynamixel) Inverse rotation direction


问:
create2 reading sensor date does not always work
I noticed that the create2 does not always provide sensor data while it's moving. Am I supposed to stop the robot, request sensor data then start it again? or am I missing something? it seems to work most of the time but once in a while I get no data back. I am trying to make it move from one point to another by starting it and then reading distance to see how far it travels every .1 seconds but sometimes it I just keeping getting no data.

I noticed this using python and C code as well.

I am using the USB port with the bit rate they recommend (115200).