Closed xu-yang16 closed 7 months ago
Hi, sorry for getting to you only after two weeks.
Yes, the command that you used, namely roslaunch ocs2_anymal_robot simple_gazebo.launch
, looks fine to me and should work. I tested it out on my machine and it works just fine.
Regarding the error, I am not quite sure what causes it. Could you try running the following, similar command?
roslaunch ocs2_anymal_robot simple_gazebo.launch z:=1.5
This command will spawn the anymal robot in a height of 1.5 meters above the ground, not 3 meters.
Edit: I agree that our README.md
file is not the most informative and we should absolutely make it more user-friendly. This is still a work-in-progress project, though, so making it easy for other people to use was not our initial goal. Better description coming soon.
Thanks for your reply.
I am using the main
branch. There are some issues I want to identify.
CentralControler
includes two types of controller: StaticController
and WBC
. They can be switched manually via the topic "/changecontroller". However, when the StaticController
is initializing, the variable `controllerTypeis not set. Therefore, the function
StaticController::getCommandMessagereturns NULL, which brings an error. To get the controller working, I set the
controllerType_` to "SIT" when iniatializing.anymal_c
uses the same name for links and joints (such as RH_HAA
etc.), which caused some errors in my case. Therefore, I renamed those links. This issue is not a major problem.blind
to true and begin running with the following command. (I attached a video here)
# In a terminal
source devel/setup.bash
roslaunch ocs2_anymal_robot simple_gazebo.launch z:=1.5 world:=normal
trot
source devel/setup.bash rostopic pub /change_controller std_msgs/String "data: 'STAND'" --once # The robot stands up as expected. rostopic pub /change_controller std_msgs/String "data: 'WBC'" --once # The robot begins to oscillate erratically before ultimately collapsing.
Our code is far from perfect, so contributions and small tweaks are definitely welcome.
Unfortunately, I do not have access to the video, you may have forgotten to change the access permissions.
We did have similar issues with the robot starting to oscillate and going crazy, I will talk about this issue after I will have seen the video.
Sorry. I changed the access permission and you should be able to watch the video now.
Could you possibly create a rosbag
and record all the topics such that I can verify that all the necessary information is being communicated to the individual nodes?
Edit: @xu-yang16 the second maintainer, @KortexXD, is more knowledgeable than I am and will help you out with this issue.
I attached a rosbag
file here and the command rosbag info 2024-03-13-14-11-59.bag
gives the following output. It seems that even though I set the parameter blind
to true
, the camera is still working. But I guess that is not a big issue nevertheless.
path: 2024-03-13-14-11-59.bag
version: 2.0
duration: 27.9s
start: Mar 13 2024 14:12:00.04 (1710310320.04)
end: Mar 13 2024 14:12:27.95 (1710310347.95)
size: 3.3 GB
messages: 94877
compression: none [873/873 chunks]
types: diagnostic_msgs/DiagnosticArray [60810da900de1dd6ddd437c3503511da]
dynamic_reconfigure/Config [958f16a05573709014982821e6822580]
dynamic_reconfigure/ConfigDescription [757ce9d44ba8ddd801bb30bc456f946f]
gazebo_msgs/LinkStates [48c080191eb15c41858319b4d8a609c2]
gazebo_msgs/ModelStates [48c080191eb15c41858319b4d8a609c2]
gazebo_msgs/PerformanceMetrics [884f71fd5037b886ec5e126b83c4425a]
geometry_msgs/PoseArray [916c28c5764443f268b296bb671b9d97]
ocs2_gazebo/JointCommandArray [b2c52b67c2f09045ab969e8432fb1f2a]
ocs2_gazebo/RobotState [9c6fb24a2178a03e3878a5d4a78d8e5b]
ocs2_msgs/mode_schedule [9aa75d28b36c292b797e36e87614038a]
ocs2_msgs/mpc_flattened_controller [9355aadb2928f436a41799dd737c0f53]
ocs2_msgs/mpc_observation [c4075a25799f2a89c6d62b26e93cb66f]
ocs2_msgs/mpc_target_trajectories [2d8da69ddfcd018a998edad053f8c7b6]
rosgraph_msgs/Clock [a9c97c1d230cfc112e270351a944ee47]
rosgraph_msgs/Log [acffd30cd6b6de30f120938c17c593fb]
sensor_msgs/CameraInfo [c9a58c1b0b154e0e6da7578cb991d214]
sensor_msgs/CompressedImage [8f7a12909da2c9d3332d540a0977563f]
sensor_msgs/Image [060021388200f6f0f447d0fcd9c64743]
sensor_msgs/PointCloud2 [1158d486dd51d683ce2f1be655c3c181]
std_msgs/Bool [8b94c1b53db61fb6aed406028ad6332a]
std_msgs/String [992ce8a1687cec8c8bd883ec73ca41d1]
tf2_msgs/TFMessage [94810edda583a504dfda3829e70d7eec]
theora_image_transport/Packet [33ac4e14a7cff32e7e0d65f18bb410f3]
visualization_msgs/Marker [4048c9de2a16f4ae8e0538085ebf1b97]
visualization_msgs/MarkerArray [d155b9ce5188fbaf89745847fd5882d7]
topics: /anymal_joint_controller/joint_controller/switched_model/command 7390 msgs : ocs2_gazebo/JointCommandArray
/anymal_mpc_mode_schedule 1 msg : ocs2_msgs/mode_schedule
/anymal_mpc_observation 29 msgs : ocs2_msgs/mpc_observation
/anymal_mpc_policy 26 msgs : ocs2_msgs/mpc_flattened_controller
/anymal_mpc_target 50 msgs : ocs2_msgs/mpc_target_trajectories
/camera/depth/camera_info 72 msgs : sensor_msgs/CameraInfo
/camera/depth/image_raw 72 msgs : sensor_msgs/Image
/camera/depth/points 72 msgs : sensor_msgs/PointCloud2
/camera/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/camera/parameter_updates 1 msg : dynamic_reconfigure/Config
/camera/rgb/camera_info 72 msgs : sensor_msgs/CameraInfo
/camera/rgb/image_raw 70 msgs : sensor_msgs/Image
/camera/rgb/image_raw/compressed 69 msgs : sensor_msgs/CompressedImage
/camera/rgb/image_raw/compressed/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/camera/rgb/image_raw/compressed/parameter_updates 1 msg : dynamic_reconfigure/Config
/camera/rgb/image_raw/compressedDepth/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/camera/rgb/image_raw/compressedDepth/parameter_updates 1 msg : dynamic_reconfigure/Config
/camera/rgb/image_raw/theora 72 msgs : theora_image_transport/Packet
/camera/rgb/image_raw/theora/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/camera/rgb/image_raw/theora/parameter_updates 1 msg : dynamic_reconfigure/Config
/change_controller 2 msgs : std_msgs/String (2 connections)
/clock 24399 msgs : rosgraph_msgs/Clock
/diagnostics 13 msgs : diagnostic_msgs/DiagnosticArray
/gazebo/link_states 24301 msgs : gazebo_msgs/LinkStates
/gazebo/model_states 24301 msgs : gazebo_msgs/ModelStates
/gazebo/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/gazebo/parameter_updates 1 msg : dynamic_reconfigure/Config
/gazebo/performance_metrics 109 msgs : gazebo_msgs/PerformanceMetrics
/left_camera/depth/camera_info 72 msgs : sensor_msgs/CameraInfo
/left_camera/depth/image_raw 72 msgs : sensor_msgs/Image
/left_camera/depth/points 72 msgs : sensor_msgs/PointCloud2
/left_camera/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/left_camera/parameter_updates 1 msg : dynamic_reconfigure/Config
/left_camera/rgb/camera_info 72 msgs : sensor_msgs/CameraInfo
/left_camera/rgb/image_raw 70 msgs : sensor_msgs/Image
/left_camera/rgb/image_raw/compressed 70 msgs : sensor_msgs/CompressedImage
/left_camera/rgb/image_raw/compressed/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/left_camera/rgb/image_raw/compressed/parameter_updates 1 msg : dynamic_reconfigure/Config
/left_camera/rgb/image_raw/compressedDepth/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/left_camera/rgb/image_raw/compressedDepth/parameter_updates 1 msg : dynamic_reconfigure/Config
/left_camera/rgb/image_raw/theora 73 msgs : theora_image_transport/Packet
/left_camera/rgb/image_raw/theora/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/left_camera/rgb/image_raw/theora/parameter_updates 1 msg : dynamic_reconfigure/Config
/lf_foot_contact 16 msgs : std_msgs/Bool
/lh_foot_contact 19 msgs : std_msgs/Bool
/ocs2_anymal/currentCollisionSpheres 573 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/currentFeetPoses 573 msgs : geometry_msgs/PoseArray
/ocs2_anymal/currentState 573 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/desiredAngVelTrajectory 24 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/desiredBaseTrajectory 24 msgs : visualization_msgs/Marker
/ocs2_anymal/desiredFeetTrajectory/LF 24 msgs : visualization_msgs/Marker
/ocs2_anymal/desiredFeetTrajectory/LH 24 msgs : visualization_msgs/Marker
/ocs2_anymal/desiredFeetTrajectory/RF 24 msgs : visualization_msgs/Marker
/ocs2_anymal/desiredFeetTrajectory/RH 24 msgs : visualization_msgs/Marker
/ocs2_anymal/desiredFeetVelTrajectory/LF 24 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/desiredFeetVelTrajectory/LH 24 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/desiredFeetVelTrajectory/RF 24 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/desiredFeetVelTrajectory/RH 24 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/desiredPoseTrajectory 24 msgs : geometry_msgs/PoseArray
/ocs2_anymal/desiredVelTrajectory 24 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/localTerrain 26 msgs : visualization_msgs/Marker
/ocs2_anymal/optimizedPoseTrajectory 24 msgs : geometry_msgs/PoseArray
/ocs2_anymal/optimizedStateTrajectory 24 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/swing_planner/nominalFootholds_LF 27 msgs : geometry_msgs/PoseArray
/ocs2_anymal/swing_planner/nominalFootholds_LH 27 msgs : geometry_msgs/PoseArray
/ocs2_anymal/swing_planner/nominalFootholds_RF 27 msgs : geometry_msgs/PoseArray
/ocs2_anymal/swing_planner/nominalFootholds_RH 27 msgs : geometry_msgs/PoseArray
/ocs2_anymal/swing_planner/trajectory_LF 27 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/swing_planner/trajectory_LH 27 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/swing_planner/trajectory_RF 27 msgs : visualization_msgs/MarkerArray
/ocs2_anymal/swing_planner/trajectory_RH 27 msgs : visualization_msgs/MarkerArray
/rear_camera/depth/camera_info 72 msgs : sensor_msgs/CameraInfo
/rear_camera/depth/image_raw 72 msgs : sensor_msgs/Image
/rear_camera/depth/points 72 msgs : sensor_msgs/PointCloud2
/rear_camera/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/rear_camera/parameter_updates 1 msg : dynamic_reconfigure/Config
/rear_camera/rgb/camera_info 72 msgs : sensor_msgs/CameraInfo
/rear_camera/rgb/image_raw 70 msgs : sensor_msgs/Image
/rear_camera/rgb/image_raw/compressed 69 msgs : sensor_msgs/CompressedImage
/rear_camera/rgb/image_raw/compressed/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/rear_camera/rgb/image_raw/compressed/parameter_updates 1 msg : dynamic_reconfigure/Config
/rear_camera/rgb/image_raw/compressedDepth/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/rear_camera/rgb/image_raw/compressedDepth/parameter_updates 1 msg : dynamic_reconfigure/Config
/rear_camera/rgb/image_raw/theora 73 msgs : theora_image_transport/Packet
/rear_camera/rgb/image_raw/theora/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/rear_camera/rgb/image_raw/theora/parameter_updates 1 msg : dynamic_reconfigure/Config
/rf_foot_contact 17 msgs : std_msgs/Bool
/rh_foot_contact 3 msgs : std_msgs/Bool
/right_camera/depth/camera_info 72 msgs : sensor_msgs/CameraInfo
/right_camera/depth/image_raw 72 msgs : sensor_msgs/Image
/right_camera/depth/points 72 msgs : sensor_msgs/PointCloud2
/right_camera/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/right_camera/parameter_updates 1 msg : dynamic_reconfigure/Config
/right_camera/rgb/camera_info 72 msgs : sensor_msgs/CameraInfo
/right_camera/rgb/image_raw 70 msgs : sensor_msgs/Image
/right_camera/rgb/image_raw/compressed 70 msgs : sensor_msgs/CompressedImage
/right_camera/rgb/image_raw/compressed/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/right_camera/rgb/image_raw/compressed/parameter_updates 1 msg : dynamic_reconfigure/Config
/right_camera/rgb/image_raw/compressedDepth/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/right_camera/rgb/image_raw/compressedDepth/parameter_updates 1 msg : dynamic_reconfigure/Config
/right_camera/rgb/image_raw/theora 73 msgs : theora_image_transport/Packet
/right_camera/rgb/image_raw/theora/parameter_descriptions 1 msg : dynamic_reconfigure/ConfigDescription
/right_camera/rgb/image_raw/theora/parameter_updates 1 msg : dynamic_reconfigure/Config
/robot_description/anymal/state 7815 msgs : ocs2_gazebo/RobotState
/rosout 473 msgs : rosgraph_msgs/Log (7 connections)
/rosout_agg 434 msgs : rosgraph_msgs/Log
/tf 1146 msgs : tf2_msgs/TFMessage
/tf_static 1 msg : tf2_msgs/TFMessage
Hi, thanks for the feedback.
I've checked the issue you reported, but I'm not sure what caused strange behavior of the robot. I attempted to replicate your problem by creating new environment and using the readme
. For me it was running normally here.
Is it possible that you've made some changes in the controller section that can cause this behavior? We encountered an issue when we modified the robot's model, particularly its inertial parameters, which caused oscillation too.
Additionally, the initial z position is higher because when you spawn the robot, it needs some time to move joints from the spawn position to the sitting position, I've checked 1.5 m and it works just fine.
I currently use Ubuntu 20.04.6 LTS
and ros-noetic
, so there might be compatibility issues to consider.
You mentioned setting the parameter blind
to true
. Just to clarify, this parameter isn't related to the cameras themselves, but rather to mapping the surrounding terrain. When this parameter is set to true, the robot doesn't generate an elevation map from any of the cameras, although the cameras remain active. In my video, you can see a purple square under the robot, this represents the elevation map.
Closing for inactivity.
Thanks for your amazing work, but I have no idea how to get it running. I am using the main branch and I failed to run with the following command:
However, the launch file
ocs2_anymal_robot/launch/simple_gazebo.launch
specifies the initial z pos as 3.0 meter, which causes the robot falling and the program collapsing. I want to know whether the command I used to run was correct. Thanks so much!The error information is attached as follows: