ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

yanaing's profile - activity

2022-11-04 09:46:38 -0500 received badge  Nice Question (source)
2021-09-08 15:10:26 -0500 received badge  Famous Question (source)
2021-09-08 15:10:26 -0500 received badge  Notable Question (source)
2021-02-04 22:16:06 -0500 received badge  Famous Question (source)
2021-01-03 15:12:08 -0500 received badge  Student (source)
2020-12-29 20:54:48 -0500 commented answer Odometry drift and how to fix

This might be one of the solutions, and also using IMU. The problem also having is that the robot itself could not go st

2020-12-29 20:45:15 -0500 received badge  Notable Question (source)
2020-12-28 14:41:15 -0500 received badge  Popular Question (source)
2020-12-28 03:57:39 -0500 asked a question Odometry drift and how to fix

Odometry drift and how to fix Asking for advice on how should I fix the odometry drifting of the wheel. I detail of my p

2020-12-03 05:44:30 -0500 received badge  Popular Question (source)
2020-12-03 03:46:51 -0500 received badge  Supporter (source)
2020-12-03 03:45:59 -0500 marked best answer Catch ctrl-C and Set value

I am developing a robot and I wrote some programs for that robot. In the robot's motor driving node, I subscribed the topic from /cmd_vel topic. What the current issue is that when the motor is running and if I terminate the motor driving node with ctrl-C, the motor is still running.

Is there any way to put the motor values with 0 before terminating the program? I am using ROS melodic with python as the following.

#!/usr/bin/env python
import ........

class main():
    def __init__(self):
         rospy.init_node("robot", anonymous=False)
         rospy.Subscriber(..........)
         self.pub=rospy.Publisher(..........)

         rospy.Timer(rospy.Duration(0.2), self.main_callback)
         while not rospy.is_shutdown():
              rospy.sleep(0.2)
              print("-----------------")

     def main_callback(self, event):
           ......................
           motor_1 = 50
           ....end.....

if __name__="__main__":
          try: main()
          except rospy.ROSInterruptException: pass

As with this example, some way to set the value motor_1=0 before terminating the node.

2020-12-03 03:45:47 -0500 received badge  Rapid Responder (source)
2020-12-03 03:45:47 -0500 answered a question Catch ctrl-C and Set value

Thanks... It work.! I finalize my motor node as follwoing. #!/usr/bin/env python import ........ class main(): def

2020-12-02 01:46:59 -0500 asked a question Catch ctrl-C and Set value

Catch ctrl-C and Set value I am developing a robot and I wrote some programs for that robot. In the robot's motor drivin

2020-08-04 01:34:17 -0500 received badge  Famous Question (source)
2020-07-23 06:50:04 -0500 received badge  Famous Question (source)
2020-05-25 06:55:22 -0500 received badge  Notable Question (source)
2020-05-03 09:02:20 -0500 received badge  Notable Question (source)
2020-04-16 20:51:25 -0500 received badge  Enthusiast
2020-04-16 20:51:25 -0500 received badge  Enthusiast
2020-04-13 21:48:13 -0500 received badge  Popular Question (source)
2020-04-13 10:33:58 -0500 received badge  Popular Question (source)
2020-04-13 08:21:20 -0500 marked best answer Ho to publish a transform between base_link and map

Hi, I am trying to move a robot through the map in the RVIZ. I have a robot URDF file and also a map. Is it possible to publish a transform between robot base link and map?

By assuming that it is possible, I am trying to is that,

  <launch>
    <arg name="model" default="$(find robot_description)/urdf/description.urdf"/>
    <arg name="gui" default="true" />
    <arg name="rvizconfig" default="$(find urdf_tutorial)/rviz/urdf.rviz" />

    <param name="use_sim_time" value="false"/>
    <param name="robot_description" command="$(find xacro)/xacro $(arg model)" />
    <param name="use_gui" value="$(arg gui)" />

    <node pkg="map_server" type="map_server" name="map_server" args="$(find lidar_simulation)/map/z_map_canteen_28_03_test1.yaml">
      <param name="frame_id" value="map" />
    </node>

    <node pkg="tf" type="static_transform_publisher" name="base_map" args="0 0 0 0 0 0 /odom /map 100" />
    <node pkg="tf" type="static_transform_publisher" name="base_link_odom" args="0 0 0 1.571 0 0 /map /base_link 100" />

    <node if="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
    <node unless="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />

    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
    <node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />

  </launch>

The above is the launch file. When I launch it, the RVIZ opens and can also visualize the robot and the map. example

To move the robot along with the map, I use topic_tools/transform package and publishing the topic with the following commands.

rosrun topic_tools transform /tf /tf tf2_msgs/TFMessage '[std_msgs.msgeader(0, rospy.Time.now(), "/map"), "/base_link", geometry_msgs.msg.Transform(geometry_msgs.msg.Vector3(1,1,0), geometry_msgs.msg.Quaternion(1.571,0,0,1))]' --import rospy std_msgs geometry_msgs

rosrun topic_tools transform /tf /tf tf2_msgs/TFMessage 'geometry_msgs.msg.TransformStamped [std_msgs.msg.Header(0, rospy.Time.now(), "/map"), "/base_link", geometry_msgs.msg.Transform(geometry_msgs.msg.Vector3(1,1,0), geometry_msgs.msg.Quaternion(1.571,0,0,1))]' --import rospy std_msgs geometry_msgs

Since, the /tf topic uses tf2_msgs/TFMessage and, the rosmsg types and details

But this not working by showing the error TypeError: Invalid number of arguments, args should be ['transforms'] args are( ) . Is there any way to move the robot along with the map or also do my currently trying ways correct?

Thanks for your attention.

2020-04-13 08:21:20 -0500 received badge  Scholar (source)
2020-04-13 08:18:38 -0500 commented answer Ho to publish a transform between base_link and map

It works. But the node I have used it tf and therefor I used rosrun tf static_transform_publisher 1 1 0 1.571 0 0 map ba

2020-04-13 02:04:47 -0500 edited question Ho to publish a transform between base_link and map

Ho to publish a transform between base_link and map Hi, I am trying to move a robot through the map in the RVIZ. I have

2020-04-13 02:04:47 -0500 received badge  Editor (source)
2020-04-13 02:02:25 -0500 edited question Ho to publish a transform between base_link and map

Ho to publish a transform between base_link and map Hi, I am trying to move a robot through the map in the RVIZ. I have

2020-04-13 01:57:13 -0500 asked a question Ho to publish a transform between base_link and map

Ho to publish a transform between base_link and map Hi, I am trying to move a robot through the map in the RVIZ. I have

2020-04-12 22:45:24 -0500 commented question URDF spawn error, robot float on the ground plane

According to your instruction, I set the parameter to PAUSE, I spawn above the ground with the value of -z. If PAUSE val

2020-04-11 07:17:17 -0500 asked a question URDF spawn error, robot float on the ground plane

URDF spawn error, robot float on the ground plane Hi, I build a robot model in the URDF file and also tested with t